title: Creating Custom Helper Functions in within Packages Like in Codeigniter
body: <p>Am new to Laravel and i have been trying to create a helper function like i would in codeigniter within a demo package am currently developing. But, you know, being knew to the framework it seems a little bit hard to get that done as i have applied some helps i could find online to no avail.</p>
  
  <p><strong>My Directory Structure Looks like So:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/rKU0W.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rKU0W.jpg" alt="Directory Structure"></a></p>
  
  <p><strong>I have just one function in the app.php file</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>if (! function_exists('baxi_services')) {
      function baxi_services()
      {
         $data = ['web dev', 'web design', 'SEO'];
  
         return json_decode($data, JSON_PRETTY_PRINT);
      }
  }
  </code></pre>
  
  <p><strong>The composer.json file has these lines:</strong></p>
  
  <pre><code> "autoload": {
          "psr-4": {
              "Courage\\Baxi\\": "src/"
          },
          "files": [
              "src/helpers/app.php"
          ]
      }
  </code></pre>
  
  <p>And the problem is, when i call this function in my controller like so:</p>
  
  <pre class="lang-php prettyprint-override"><code>  return baxi_services(); 
  </code></pre>
  
  <p>i get the following Error:</p>
  
  <pre><code>Call to undefined function Courage\Baxi\Http\Controllers\baxi_services()
  </code></pre>
  
  <p>I have all ran composer dum-autoload command in my terminal but that doesnt solve the problem</p>