title: How to call custom helper function in filesystems
body: <p>My situation is where i need to load <code>tenant_path()</code> inside the <code>filesystems.php</code> like the code below. it is for <code>tenant_path()</code> function located in <code>helpers.php</code> which is my custom helper class <code>App/Helpers/helpers.php</code>. the purpose is for dynamic path for different tenant.</p>
  
  <p>My problem is <code>tenant_path()</code> is not loaded in <code>filesystems.php</code> but when i tried in middleware, controller and model its work.. seems like <code>tenant_path()</code> is not loaded yet in when Laravel run the <code>filesystems.php</code>. but how the <code>storage_path()</code> in <code>Foundation/helpers</code> works while my <code>tenant_path()</code> is not working in <code>filesystem.php</code></p>
  
  <p>Error show</p>
  
  <blockquote>
  <pre><code>[ReflectionException]             
  Class path.tenant does not exist
  </code></pre>
  </blockquote>
  
  <p>Below is my code</p>
  
  <p><strong>Filesystems.php</strong></p>
  
  <pre><code>'image' =&gt; [
              'driver' =&gt; 'local',
              'root' =&gt; storage_path('app/public/images/'.tenant_path()),
              'url' =&gt; env('APP_URL').'/storage',
              'visibility' =&gt; 'public',
          ],
  </code></pre>
  
  <p><strong>Helpers.php</strong></p>
  
  <pre><code>if (! function_exists('tenant_path')) {
      /**
       * Get the path to the tenant folder.
       *
       * @param  string  $path
       * @return string
       */
      function tenant_path($path = '')
      {
          return ""; //also not working
          return app()-&gt;make('path.tenant').($path ? DIRECTORY_SEPARATOR.ltrim($path, DIRECTORY_SEPARATOR) : $path);
      }
  }
  </code></pre>
  
  <p><strong>AppServiceProvider</strong></p>
  
  <pre><code>Tenanti::connection('company', function (TenantDomain $entity, array $config) {
              $config['database'] = env('TENANTI_DB_PREFIX')."_{$entity-&gt;id}";
  
              $this-&gt;app-&gt;bind('path.tenant', function () use ($entity) {
                  return "{$entity-&gt;sub_domain}.".env('APP_DOMAIN');
              });
  
              return $config;
          });
  </code></pre>
  
  <p><strong>composer.json</strong></p>
  
  <pre><code>"autoload": {
          "files": ["app/Helpers/helpers.php"]
      },
  </code></pre>