How to pass query string with routes in laravel 5.4 -
i using laravel 5.4. want use query string below:
tempsite.com/lessons?id=23 for getting how routes modified. possible give route in following way.
route::get('lessons/id={id}', ['as' => 'lessons.index', 'uses' => 'lessons\lessoncontroller@index']); but adding '?' not getting me. please provide solution possible.
if using resourceful controllers, routes handled put
route::resource('lessons', 'lessons\lessoncontroller'); you can use route model binding bind model instance matches particular id.
route::model('lesson', lesson::class); this done in routeserviceprovider.
i suggest having read of following documentation on laravel website https://laravel.com/docs/5.4/routing. provides insight in how routes work , how should structured.
Comments
Post a Comment