4
I need to pass a variable from a route to a controller method.
The route:
Route::get('busca/{id}', 'MatriculasController@busca');
How can I pass the variable id
for the method?
4
I need to pass a variable from a route to a controller method.
The route:
Route::get('busca/{id}', 'MatriculasController@busca');
How can I pass the variable id
for the method?
4
You use as parameter, slug
of his method.
public function busca($id){
dd($id);
}
Browser other questions tagged php laravel-4
You are not signed in. Login or sign up in order to post.
Thank you very much!
– Amanda Lima
You are welcome! You are using the variable as
slug
. But if you use as a parameter in URL, p.ebusca?id={$id}
, you put in the methodInput::get('id')
.– Diego Souza