Home » Php » php – Route [blog.all_article] not defined

php – Route [blog.all_article] not defined

Posted by: admin February 25, 2020 Leave a comment


I want to go from home.blade.php to all_article.blade.php, but they tell me that such a route was not found. What am I doing wrong. Thanks in advance for your help.


 <a href="{{route('blog.all_article')}}" class="btn btn-primary pull-right"><i class="fa fa-plus-square-o"></i> Add</a> 


public function articlesAll_blade(){
   return view('blog.all_article',[
     'articles' => Article::orderBy('created_at', 'desc')->paginate(10),
      'footers' => System::all(),


 Route::get('/', '[email protected]', function () {
     return view('blog.home');

 Route::get('/all_article', '[email protected]_blade', function () {
     return view('blog.all_article');
How to&Answers:

what you are missing is a route name, add a name to your route

Route::get('/all_article', '[email protected]_blade', function () {
     return view('blog.all_article');
 })->name('blog.all_article');// see the name part

doc link https://laravel.com/docs/routing#named-routes


Route::get('/all_article','[email protected]_blade')->name('blog.all_article');