How to composer dump-autload in PHP I want to be able to run composer dump-autoload but in php not command line. Is this possible?
Thanks
@timlees
Route::get('/updateapp', function()
{
exec('composer dump-autoload');
echo 'composer dump-autoload complete';
});
Or
exec('composer dump-autoload'); // if you're not planning to access it through a route.
I get the following error
Command "dump-autoload" is not defined
I am using Laravel 5.
But dump-autoload is not an artisan command. It's a composer command. Wasn't there an exec() function in php which runs commands in the command line? Check Scheduler Behind the Scenes lesson about that.
Try this:
exec('/usr/bin/php '.base_path().'/artisan dump-autoload');
I ended up using the following
system('composer dump-autoload');
And it worked perfect. Thanks for all your help.
Please sign in or create an account to participate in this conversation.