PHPackages                             mvo/me-like - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. mvo/me-like

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

mvo/me-like
===========

Let users like things, confirm their likes via email and keep track of the count.

v0.1.1(6y ago)0559[6 PRs](https://github.com/m-vo/me-like/pulls)1MITPHPPHP &gt;=7.4

Since Apr 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/m-vo/me-like)[ Packagist](https://packagist.org/packages/mvo/me-like)[ RSS](/packages/mvo-me-like/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (2)Dependencies (11)Versions (9)Used By (1)

me like! ▲
==========

[](#me-like-)

[![Demo](docs/like.gif)](docs/like.gif)

What does it do?
----------------

[](#what-does-it-do)

This bundle provides a widget that users can click on to like things (backed by an API).

Likes need to be confirmed in order to count - this is accomplished by asking for an email address and sending an email with a link to confirm the like. This doubles as a constraint: each user (email) can only like (each endpoint) once.

There can be multiple endpoints/domains (= *things to like*) that are identified by a unique string. This can e.g. be a single one (`idea`), or a fixed or dynamic list (`project.1`, `project.2`, …) - the system actually doesn't care. It will ask *your code* if a given endpoint is valid when listing/adding/confirming likes.

The js widget talks to the server system via an API endpoint. It also acts as a proxy for confirming likes. For this to work, we define a distinct URL fragment for the widget listens on that contains the 'confirm token' (same holds true for the user token; see below).

### Security &amp; privacy

[](#security--privacy)

- The email addresses itself are never stored - only a one way hash of them. Plus: the hash is unique for every endpoint and system.
- The API **does not** allow checking if a certain email address has already 'liked' the endpoint. The widget (client side), however, acquires a token and stores it in `localstorage` when requesting a new like. This token allows it to query information about the user's like (and therefore can provide a nicer UI).
- The user token gets appended to the 'confirm url' allowing the widget to read it and refresh the local version.

#### Stored things on the server

[](#stored-things-on-the-server)

- a table of hashed emails (see `Like` entity) in your database

#### Stored things at the client

[](#stored-things-at-the-client)

- a user token (`localstorage`)

Setup
-----

[](#setup)

1. Require the bundle and register it.

    ```
    composer require mvo/me-like
    ```
2. Render the widget to the desired endpoint in your twig template:

    ```
    {{ render(controller('mvo.me_like.widget', { 'endpoint': 'my-endpoint' })) }}
    ```
3. Add an endpoint handler (implementing `Mvo\MeLike\Endpoint\EndpointInterface`) that returns `VALID` for the endpoints you want to allow. You can also add random data context to the endpoint that will be available in the notification template.

    ```
     class MyEndpoint implements EndpointValidatorInterface
     {
         public function handle(string $domain, ?int $id): ?bool
         {
             return 'my-endpoint' === $domain ?
                 EndpointValidatorInterface::VALID :
                 EndpointValidatorInterface::UNKOWN;
         }

        public function addContext(string $domain, ?int $id): ?array
        {
             return null;
        }
     }
    ```

    In case your endpoint's name is in the form `.` the individual parts will be passed to your handler.

    Note that a handler will only be asked to add context for an endpoint if `handle()`returns `VALID` for this endpoint. You do not need to re-check the validity inside `addContext()`.
4. If you're not using autoconfiguration, tag the handler it with `mvo_me_like.endpoint`.
5. Make sure to load the js widget and minimal styles. The bundle ships with a compiled version (`like_widget.js`, `like_widget.css`) which automatically initializes the widgets and has some opinionated styles. Feel free to build your own version (see sources under `/layout`).

Configuration
-------------

[](#configuration)

1. The systems sends emails via symfony mailer. Configure the following templates and config keys to fit your needs:

    - Notification template: `@MvoMeLike\Email\confirm_like.html.twig`
    - Mailer config: ```
        mvo_me_like:
          notification:
              email_from: 'mail@example.com'
        ```
2. Adapt translations to your needs. The email subject can also be modified this way. If you need context sensitive parameters pass them in your endpoint handler under the key `email_subject`.
3. You can also configure the token names (user token + confirm token) that are appended to the URL (e.g. in case you've got some anchors with the same names):

    ```
    mvo_me_like:
      user_token: 'tok_u'
      confirm_token: 'tok_c'
    ```

    This will result in a 'confirm url' like so: [https://example.com/some/site#tok\_u=](https://example.com/some/site#tok_u=)&amp;tok\_c=

    All tokens have a length of 64 characters.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2214d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ebbd1a2ef505d2afa0c828ea08244e9636e397bc837ec3cf6daa74ff07f08e0b?d=identicon)[m-vo](/maintainers/m-vo)

---

Top Contributors

[![m-vo](https://avatars.githubusercontent.com/u/5305677?v=4)](https://github.com/m-vo "m-vo (8 commits)")

---

Tags

emailconfirmlikevote

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mvo-me-like/health.svg)

```
[![Health](https://phpackages.com/badges/mvo-me-like/health.svg)](https://phpackages.com/packages/mvo-me-like)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
