Kishan Dalsania
Kishan Dalsania

Reputation: 95

how to pass the id as an argument in the laravel link

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

Answers (1)

Bara&#39; ayyash
Bara&#39; ayyash

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

Related Questions