¡GoConqr estrena diseño! Cuéntanos qué te parece.

Apuntes

Route Model Binding

Luis Rojas Español 1 página

Contenido del apunte (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;

}

Información

Descripción
Example of how simple route model binding works
Creado por
Luis Rojas · may 2017
Actualizado
4 may 2017
Visitas
109
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?