Reputation: 95
I am new at laravel and i am using the follow syntax to call the controller directly from the url. Now I dont know how to pass the argument in these link. Please needed your help for these.
Route::get('/pagelink', 'YourController@callMeDirectlyFromUrl');
And in the link i have written these:
<a href="{{action('YourController@callMeDirectlyFromUrl')}}">Link name/Embedded Button</a>
Now how to pass the id in these code.
Upvotes: 1
Views: 659
Reputation: 1935
you can do it like this :
Route::get('/pagelink/{id}', 'YourController@callMeDirectlyFromUrl');
<a href="{{action('YourController@callMeDirectlyFromUrl', ['id' => 22])}}">Link name/Embedded Button</a>
Upvotes: 2