Skip to content

coopTilleuls/easyadmin-mercure-demo

Repository files navigation

EasyAdmin/Mercure demo

Features

  • While I edit an entity which gets updated on the server by another user, I get a notification and a button for updating the page I'm looking at.
  • While I am looking at an entity list, if a an entity on the page gets updated on the server by another user, I get a notification, a button for updating the page I'm looking at and the outdated entity gets highlighted.

This demo application has been generated from the MicroSymfony template.

Requirements

Installation & first run 🚀

Your 8000 and 50943 ports must be free for the Symfony CLI web server and Mercure.

composer install
make start

Then open http://127.0.0.1:8000/

Reset

To reinitialize the database you can run:

make db-init

Run the tests

To check the PHPUnit tests, you can run:

make test

Stop the Docker containers and the Symfony web server

make stop

Manual update

You can also manually emit notifications in your application check out AppController:

  $topic = $this->adminUrlGenerator->setController(Article::class)
          ->unsetAllExcept('crudControllerFqcn')->generateUrl();
  $update = new Update(
      $topic,
      (string) json_encode(['id' => 1]),
  );

Of course you should rely on an actual article instance in this case.

Todo

To try/test

Stack

Dev-tools

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published