GoConqr has a new look! Let us know what you think.

Notes

Route Model Binding

Luis Rojas Spanish 1 page

Content of the notes (1)

Page 1

It needs a wildcard in the route.

This wildcard needs to match against the controller method who's expecting the wildcard.

Laravel assumes a primary key for the model wildcard.

Route::get('Model/{model}', 'ModelController@nameMethod');

public function nameMethod(Model $model){

return $model;

}

Information

Description
Example of how simple route model binding works
Created by
Luis Rojas · May 2017
Updated
May 4, 2017
Views
109
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?