So I'm going through the Laravel 5 Fundamentals cast and I thought I would just make a link that would help with the edit article section.
I first tried:
{!! link_to_route(route('articles.edit', $article->id), 'Edit this post') !!}
And that wasn't flying. The error was stating that the route didn't exist, although it was printing the correct route and could be pasted into the browser and visited successfully.
I ended up using the below code to accomplish what I wanted:
<a href="{{ action("ArticlesController@edit", $article->id) }}">Edit this post</a>
Is there a cleaner way to accomplish this kind of link or button?
Thanks in advance
As you can see here: http://laravel.com/docs/4.2/helpers#urls
link_to_route works in this way:
link_to_route('articles.edit', 'Edit this post', ["article"=>$article->id]);
I don't know in laravel 5, however I don't think you should use route helper inside link_to_route helper
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community