Friday, March 17, 2017

Laravel - How to pass a variable to controller through resource route?

I've defined this resource in web.php of Laravel app,

Route::resource('Student', 'StudentCtrl');

and I have a variable which contains name of meta file,

$metaFile = 'student_meta.json';

I want to pass $metaFile to StudentCtrl, so I can catch the file name there.

I'm using Laravel 5.4.

Thanks.



via Gaurav Deshpande

Advertisement