Dmitriy Skogorev Dmitriy Skogorev - 19 days ago 8
PHP Question

How to build path to route in laravel with parameter?

I have next route

Route::get('org/edit/{id}/', ['as' => 'org.edit', 'uses' => 'OrgController@edit']);

and then create link to this route by laravel blade template:

<a href="{{ route('org.edit', [$org->id]) }}" class="btn btn-primary"><span class="glyphicon glyphicon-edit"></span></a>

what i expects to see:


what i get:


what i'm doing wrong?


Try passing it as a key value pair.

{{ route('org.edit', ['id' => $org->id]) }}