title: How to make a custom helper function, available in every controller for Laravel 5
body: <p>I just read <a href="https://stackoverflow.com/questions/44021662/how-to-create-global-function-that-can-be-accessed-from-any-controller-and-blade">this post</a> to make a global function which is able to be accessed from any controller. But I don't understand how it works. </p>
  
  <p>I want to make variable 'services' accessible from any controller. So, I make General.php and put it in app/Http. Here is the code.</p>
  
  <pre><code>&lt;?php
  class General {
  
     public function getServices() {
        $services = "SELECT * FROM products";
        return $services;
     }
  }
  </code></pre>
  
  <p>And in the controller I include it</p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers;
  
  use App\Http\General;
  use Illuminate\Http\Request;
  
  class HomeController extends Controller {
     public function index() {
  
         $title = 'Our services';
         $services = General::getServices();
  
         return view('welcome',  compact('title','services'));
  
     }
  }
  </code></pre>
  
  <p>When I run it I got error <code>Class 'App\Http\General' not found</code>. And then how I can 
  Anyone can help would be appreciated.</p>