mardi 23 janvier 2018

Laravel 5 : Optional parameter in routes

I am looking for a solution for this code to work with the optional parameter.Indeed placed at the beginning, this parameter is no longer considered optional but I absolutely need to have a solution.

The goal is to archive the old versions of the website by year (it's for a music festival) without having to duplicate all laravel files ...

Route::get('{year?}/lineup', 'HomeController@agenda')->name('agenda');

In this precise case :

/2018/lineup => works
/lineup => not working

Note : I'm using Laravel 5.4

An idea, a suggestion to archive by date the old versions of the site ? Archives must be accessible online.

Thank you



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire