Reputation: 235
New to Laravel so please be patient with me, I have a route in web.php as below :
Route::get('/add_rcord/{formid}/{userid}', 'site_controller@add_rcord')->name('add_rcord');
I need to go to the URL by clicking a link while passing 2 variables as below :
<?php
$value1=1;
$value2=2; ?>
<a href="{{route('/add_rcord/$value1/$value2')}}">Add Record</a>
This does not work , Can someone advise me how can I do that
Upvotes: 2
Views: 2758
Reputation: 34688
Define the parameter name, if you have multiple parameter :
route('add_rcord', ['formid' => $value1, 'userid' => $value2])
Upvotes: 6