Dynamic date creation depending on the current fixture with nelmio/alice

Published on 2021-10-24 • Modified on 2021-10-24

This snippet shows how to create a dynamic date depending on the current fixture with nelmio/alice. The trick is to use the $current variable within the argument of the date_create function. In this case, we create a hundred events every day from tomorrow.


App\Entity\Event:
    event_{1..100}:
        start_time: <(date_create('+'. $current. 'day'))>

 More on Stackoverflow   Read the doc  Random snippet

  Work with me!