I want to pass an ID "0" to the controller if my url is user/new, how can i do it on the route.php in laravel?
I imagined something like this, but I don't think is that simple.
Route::get('user/new','UserController@edit', ['id'=>'0']);
Route::get('user/edit/{id}','UserController@edit');
With normal .htaccess i'd do something like this:
RewriteRule ^user/new /www/user/edit.php?id=0 [L,QSA]
RewriteRule ^user/(.*) /www/user/edit.php?id=$1 [L,QSA]
Do I need a middleware? Is there a more simple way to do it?