Reputation: 4862
I'm new to Laravel. I have a route defined in routes.php
Route::get('article/{id}/{slug}', array('uses' => '....', 'as' => '.....'));
How can I get it using route()
? I'm trying this, but failed.
<a href="{{ route('article', $article->id, $article->slug) }}">
Upvotes: 0
Views: 3371
Reputation: 4862
I just got a solution using as
and array parameter.
Route::get('article/{id}/{slug}', array('uses' => '.....', 'as'=>'article'));
Then, call it from route()
.
<a href="{{ route('article', array($article->id, $article->slug)) }}">
Upvotes: 1