lundi 25 mars 2019

How to pass multiple parameters to laravel named resource route

I have a named route. I want to pass two parameters to the 'edit' action (for example {id} and {month}).

I tried to pass parameters through an array, but still not working.

Route::resource('admin/worktimes', 'WorktimesController')->names([
    'index' => 'worktimes',
    'show' => 'worktimes.show',
    'create' => 'worktimes.create',
    'edit' => 'worktimes.edit',
    'store' => 'worktimes.store',
    'update' => 'worktimes.update'
])



The url created is 'http://.../admin/worktimes/4/edit?month=2019-05'. I want to have something like 'http://.../admin/worktimes/4/2019-05/edit'.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire