Notas
Route Model Binding
Conteúdo das notas (1)
Página 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;
}
Informações
- Descrição
- Example of how simple route model binding works
- Criado por
- Luis Rojas
- Visualizações
- 109
- Tags
- Avaliação