Markus Michalski FAQ

Support Form: Installation and Operation

Support Form for Sylius - installation via Composer (Packeton), setup command, update, deleting old requests with a cron job, uninstall in the correct order

Deutsche Version

Back to overview

Support Form: Installation and Operation

Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net

Installation

The repository is private and provided through Packeton (https://packeton.markus-michalski.net). You receive the credentials after purchasing the license or once access is granted.

{ "repositories": [{ "type": "composer", "url": "https://packeton.markus-michalski.net" }] }
composer require mmd/sylius-support-form-plugin
  1. Register the bundle in config/bundles.php:

    Mmd\SyliusSupportFormPlugin\MmdSyliusSupportFormPlugin::class => ['all' => true],
    
  2. Import the routes, for example in config/routes/mmd_support_form.yaml:

    mmd_sylius_support_form_admin:
        resource: "@MmdSyliusSupportFormPlugin/config/routes/admin.yaml"
    
    mmd_sylius_support_form_shop:
        resource: "@MmdSyliusSupportFormPlugin/config/routes/shop.yaml"
    
  3. Run the setup command:

    bin/console mmd:support-form:setup
    

    mmd:support-form:setup runs only this plugin's open migrations, never migrations of your application or other plugins. The command is idempotent: if there is no new migration, nothing happens, even after a composer update. If Sylius' own migrations are still open, it aborts and tells you to run doctrine:migrations:migrate first. It also checks that the routes from step 2 are imported and prints the matching snippet if they are not. It never writes into your config/ directory. It asks for confirmation before running, in scripts add --no-interaction. The usual doctrine:migrations:migrate still works as an alternative. Run the command as the same user as your other console commands.

Grids, Twig hooks and the menu entry register themselves, so there is nothing else to import. The plugin ships no assets of its own, so assets:install is not needed.

Afterwards you find the settings under Admin sidebar → MMKreativ Plugins → Support form (see Configuration). The form is available at /support.

The form has no spam protection of its own. Read the known limitations before going live.

Update

composer update mmd/sylius-support-form-plugin
bin/console mmd:support-form:setup --no-interaction
bin/console cache:clear

You can safely run the setup command again after every update: without a new migration nothing happens.

Deleting old requests regularly

Stored requests contain personal data: everything customers type into the fields you defined, plus the e-mail address. They are never deleted automatically. Set up your own cron job for that:

Command Recommended interval Description
bin/console mmd:support-requests:purge --older-than=90 weekly or daily Permanently deletes all requests older than the given number of days (default: 90)

--older-than must be a positive whole number, otherwise the command aborts with an error message.

Example for the crontab of the user your other console commands run as (adjust the path):

# every Monday at 03:00: delete requests older than 90 days
0 3 * * 1 cd /var/www/shop && bin/console mmd:support-requests:purge --older-than=90 --no-interaction

There is no recycle bin and no restore. A deleted request is gone for good.

Uninstall

The order matters because Doctrine only knows the migrations while the bundle is still registered:

  1. Remove the cron job for mmd:support-requests:purge.

  2. While the bundle is still registered, roll back the three migrations, one version at a time and the newest first:

    bin/console doctrine:migrations:execute --down 'Mmd\SyliusSupportFormPlugin\Migrations\Version20260929140000'
    bin/console doctrine:migrations:execute --down 'Mmd\SyliusSupportFormPlugin\Migrations\Version20260929120000'
    bin/console doctrine:migrations:execute --down 'Mmd\SyliusSupportFormPlugin\Migrations\Version20260928095114'
    
  3. Remove the route import and the bundle entry in config/bundles.php, then run composer remove mmd/sylius-support-form-plugin.

Rolling back deletes all stored requests, field definitions and channel configurations. Back up the data first if you still need it.