I have uploaded my project on a web host and I use ftp to edit my code. The problem is that I added models using eloquent for my database and to get it work I have to download my project dans run php composer dump-autoload then re-upload. Otherwise its say class not found ... Doing this all the time is just heavy. Is there any other solution? My webhost does not have ssh or any thing to connect to the server. Neither I can use rsync like stuff. Maybe I should use an other framework than laravel4 to avoid using composer?
Composer dump-autoload It just regenerates the list of all classes that need to be included in the project (autoload_classmap. php). Ideal for when you have a new class inside your project.
Yes, manually removing all files of the autoloader in the vendor/composer/ folder should work. So, all vendor/composer/autoload_*.
If you need to regenerate your package's autoload files, you may use the php artisan dump-autoload command. This command will regenerate the autoload files for your root project, as well as any workbenches you have created.
After you create the composer. json file in your project root with the above contents, you just need to run the composer dump-autoload command to create the necessary autoloader files. These will be created under the vendor directory. Finally, you need to include the require 'vendor/autoload.
In your case, you should add your needed autoload directory to the ClassLoader::addDirectories array under /app/start/global.php. Laravel gives multiple ways to accomplish the same thing depending on your personal needs.
You can remove or not upload the bootstrap/compiled.php file. I'm not sure if this completely fixes your problem, because I'm not sure if dump-autoload generates multiple files.
[edit]An other approach is to work on your local machine and upload after you are finished.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With