title: Undefined variable: categories in blade file
body: <p>I tried to create show function for main category but there is an error showing that variable categories is undefined. can help to solve it?</p>
  
  <p>controller: </p>
  
  <pre><code>  public function show($id)
    {
      $categories = Categories::find($id);
      return view('Admin.categories.show',compact('maincategory'));
    }
  </code></pre>
  
  <p>blade:</p>
  
  <pre><code>{{ $categories-&gt;main_cate }} 
  </code></pre>
  
  <p>Route:</p>
  
  <pre><code> Route::get('/admin/show/{id?}', 
   ['uses'=&gt;'AdminCategoriesController@show','as'=&gt;'Admin.categories.show']);
  </code></pre>