php - Loading custom class in laravel without dump autoload -


i have directory /libraries/ under /app/. libraries suppose hold custom files , classes. i'm putted new file there doesn't work because need dump-autoload.. problem can't this. no access terminal etc..

i have in composer.json

"autoload": {     "classmap": [         "app/commands",         "app/controllers",         "app/models",         "app/database/migrations",         "app/database/seeds",         "app/libraries",          // <<----- 1         "app/tests/testcase.php"     ] }, 

another file in libraries beginning working fine.

my question how can load new file?

you can try tried , it's worked me. navigate vendor/composer/. since you've said have 1 php file in libraries , it's working means have in followed files , can copy/paste lines , change files.

first open file autoload_classmap.php , add @ bottom of array

'yourfile' => $basedir . '/app/libraries/yourfile.php', 

second open file autoload_static.php , @ bottom add file again

public static $classmap = array (     ...     'yourfile' => __dir__.  '/../..' . '/app/libraries/yourfile.php', 

save both files , reload. in case loaded files without need of auto-dump.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -