title: Undefined variable: categories / getting this error after clearing route
body: <p>I am using this route to get common instances for all my routes :</p>
  <pre><code>View::composer('*', 'App\Http\Controllers\Master@all');
  </code></pre>
  <p>And in my controller</p>
  <pre><code>public function all($view){
      $general = General::where('id',1)-&gt;first();
      $footer = Footer::where('id',1)-&gt;first();
      $navmenu = Navmenu::with('submenus')-&gt;where('status',1)-&gt;get();
      $socials = Social::where('status',1)-&gt;get();
      $categories = Category::where('status',1)-&gt;get();
      $footer_about = FooterLinkAbout::where('status',1)-&gt;take(5)-&gt;get();
      $footer_explore = FooterLinkExplore::where('status',1)-&gt;take(5)-&gt;get();
      $footer_cat = Footer_link_category::where('status',1)-&gt;take(5)-&gt;get();
      $fund_raised = Transection::all();
      $languages = Language::where('status',1)-&gt;get();
      $ip = '43.250.81.202';
      $arr_ip = geoip()-&gt;getLocation($ip);
      $user_location = $arr_ip-&gt;country; // get a country
      // $main_currency = Currency::where('status',1)-&gt;get();
      $currencies = Currency::where('status',1)- 
      &gt;where('session_currency','!=',Session::get('currency_c'))-&gt;get();
      $user_currency = Currency::where('session_currency',Session::get('currency_c'))-&gt;first();
      
      $currency_by_location = Currency::where('status',1)-&gt;where('country_name',$user_location)- 
      &gt;first();
  
      $view-&gt;with('general',$general)-&gt;with('footer',$footer)-&gt;with('navmenu',$navmenu)- 
      &gt;with('socials',$socials)-&gt;with('categories',$categories)-&gt;with('footer_about',$footer_about)- 
      &gt;with('footer_explore',$footer_explore)-&gt;with('footer_cat',$footer_cat)- 
      &gt;with('languages',$languages)-&gt;with('currencies',$currencies)- 
      &gt;with('user_currency',$user_currency)-&gt;with('currency_by_location',$currency_by_location)- 
      &gt;with('fund_raised',$fund_raised);
  }
  </code></pre>
  <p>But after clearing the routes using following codes :</p>
  <pre><code>php artisan cache:clear
  php artisan route:cache
  php artisan config:cache
  </code></pre>
  <p>I am getting the following error :</p>
  <p><a href="https://i.stack.imgur.com/fDfeE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fDfeE.png" alt="enter image description here" /></a></p>