title: Call to undefined function App\Http\Controllers\get_option() in laravel 8
body: <p>I'm trying to convert an Laravel 5.7 project to 8, still debugging but I can't fix that spesific issue.</p>
  <p>When I run that project I get &quot;Call to undefined function App\Http\Controllers\get_option()&quot; error.</p>
  <p>I tried:</p>
  <ul>
  <li>Change helpers.php location Providers to Controllers</li>
  <li>Remove if clause in helpers.php file</li>
  <li>Add &quot;use App\Providers\helpers;&quot; in Mainpage controller</li>
  <li>Check Laravel 8 upgrading guide (<a href="https://laravel.com/docs/8.x/upgrade" rel="nofollow noreferrer">https://laravel.com/docs/8.x/upgrade</a>)</li>
  </ul>
  <p>This is a source of error in App\Http\Controllers\MainpageController:</p>
  <pre><code>...
          $products_recommendations = Product::select('product.*')
  
              -&gt;join('product_details', 'product_details.product_id', 'product.id')
  
              -&gt;where('product_details.show_recommendations', 1)
  
              -&gt;orderBy('update_date', 'desc')
  
              -&gt;take(get_option('mainpage_list_product_count'))-&gt;get();
  ...
  </code></pre>
  <p>This is app/Providers/helpers.php file, it has get_option() function:</p>
  <pre><code>&lt;?php
  use App\Models\Option;
  use Illuminate\Support\Facades\Cache;
  
  if (! function_exists('get_option')) {
      function get_option($key) {
          //$allOptions = Cache::rememberForever('allOptions', function() {
          $minute = 60;
          $allOptions = Cache::remember('allOptions', $minute, function() {
              return Option::all();
          });
          
          return $allOptions-&gt;where('key', $key)-&gt;first()-&gt;variable;
      }
  }
  </code></pre>
  <p>How can I fix that?</p>
  <p>Note: I translated variable and function names into English for asking here.</p>