lundi 22 février 2016

Laravel 5.2 route model binding

Laravel has a documentation regarding route model binding which could be found here. But there is no example with regards to this kind of scenario:

Route::get('search/', 'ArticleController@search');

How to I implicitly bind a model into the route? I know I could do something like this directly on the controller's method.

public function search(Model $model) {
    // some code here
}

But I'm just curious on how to do it on the routes instead. Thanks!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Q6LDBs
via IFTTT

Aucun commentaire:

Enregistrer un commentaire