lundi 26 février 2018

Define dynamic value for all routes specific parameter in laravel 5.5

Route::group(['prefix'=>'admin/{apartment}/payments','middleware'=>'auth:admin'],function () {
  Route::get('/', 'Admin\PaymentController@index')->name('admin.payments');
  Route::post('/create', 'Admin\PaymentController@create')->name('admin.payments.create');
  Route::get('/update', 'Admin\PaymentController@update')->name('admin.payments.update');
  Route::get('/delete', 'Admin\PaymentController@delete')->name('admin.payments.delete');
});

  • I need to replace all routes contains apartment parameter with session value. apartment id stored in to session named as "admin_apartment_id".

  • Apartment id will be stored to the session when user login to the
    dashboard.

I need getting route like this ../dashboard/admin/10/payments

I am trying to do this for switch apartments. If there are other ways to do.please mention here.Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire