Reputation: 189
I have this route
Route::get('org/edit/{id}/', ['as' => 'org.edit', 'uses' => 'OrgController@edit']);
And then create a link to this route by using Laravel Blade template:
<a href="{{ route('org.edit', [$org->id]) }}" class="btn btn-primary"><span class="glyphicon glyphicon-edit"></span></a>
What I expect to see:
/org/edit/123/
What I get:
/org/edit?123
What am I doing wrong?
Upvotes: 0
Views: 729
Reputation: 746
Dmitriy, in this case you can try two ways.
{{ route('org.edit', ['id' => $org->id,]) }}
{{ route('org.edit', $org->id) }}
Check this out. :)
Upvotes: 1
Reputation: 33148
Try passing it as a key value pair.
{{ route('org.edit', ['id' => $org->id]) }}
Upvotes: 2