title: Undefined variable Laravel route
body: <p>I have cool models and controllers. The function does not output variables. I registered the path in the routes, but still gives an error. Writes that the <code>footers</code> variable was not found. </p>
  
  <p>web</p>
  
  <pre><code>Route::get('/app', 'SystemController@footerAll')-&gt;name('footers');
  </code></pre>
  
  <p>controller</p>
  
  <pre><code> public function footerAll(){
      return view('layouts.app', ['footers' =&gt; System::all()]);             
   }
  </code></pre>
  
  <p>layouts/app.blade.php</p>
  
  <pre><code>    @forelse ($footers as $footer)
                      &lt;div&gt;
                          &lt;h1&gt;{{$footer-&gt;marketing}}&lt;/h1&gt;
                      &lt;/div&gt;
                   @empty
                   &lt;h2 class="text-center"&gt;Epmty&lt;/h2&gt;
      @endforelse
  </code></pre>
  
  <p>If I put only a slash <code>Route::get('/', 'SystemController@footerAll')-&gt;name('footers');</code>, then the error passes and the information displays, but here all the other content on the page disappears immediatelyю</p>
  
  <p>conflict with this route</p>
  
  <pre><code> Route::get('/', 'BlogController@articlesAll', function () {
          return view('blog.home');
      });
  </code></pre>
  
  <p>web.php </p>
  
  <pre><code>    Route::get('/blog/category/{slug?}', 'BlogController@category')-&gt;name('category');
    Route::get('/blog/article/{slug?}', 'BlogController@article')-&gt;name('article');
   Route::group(['prefix'=&gt;'admin', 'namespace'=&gt;'Admin', 'middleware'=&gt; ['auth']], function(){
  
    Route::resource('/category', 'CategoryController', ['as'=&gt;'admin']);
    Route::resource('/article', 'ArticleController', ['as'=&gt;'admin']);
    Route::group(['prefix' =&gt; 'user_managment', 'namespace' =&gt; 'UserManagment'], function() {
    Route::resource('/user', 'UserController', ['as' =&gt;'admin.user_managment']);
    });
  Route::group(['middleware' =&gt; 'admin'], function() {
      Route::get('/', 'DashboardController@dashboard')-&gt;name('admin.index');
  });
  });
  Route::get('/', 'BlogController@articlesAll', function () {
      return view('blog.home');
  });
  
  Route::get('/app', 'SystemController@footerAll')-&gt;name('footers');
  </code></pre>
  
  <p>Route::post('/comment/store', 'CommentController@store')->name('comment.add');</p>
  
  <pre><code>Auth::routes();
  
  //Route::get('/home', 'HomeController@index')-&gt;name('home'); 
  
  Route::get('/home', 'HomeController@getUser')-&gt;name('users');
  </code></pre>