I am using laravel forge to deploy the application. The form submission on the local server works fine. It finds the right route declared in the route file. But it does not work on the live server. On live server when I hit submit button I got "Whoops, looks like something went wrong." message.
What could be the reasons? I will highly appreciate your help. Thanks in advance.
Here are the routes declared:
Route::get('/training/seo/outreach/brochure','BrochureDownloadController#index');
Route::post('/training/seo/outreach/brochure','BrochureDownloadController#store');
Here is the code on form
<form class="js-validate" method="post" id="brochure_download" name="brochure_download" action="{{ action('BrochureDownloadController#store')}}">
{{ csrf_field()}}
Deploy Script ( On forge)
cd /home/forge/www.xponent.com.bd
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader
composer dump-autoload
php artisan cache:clear
echo "" | sudo -S service php7.2-fpm reloadif [ -f artisan ]
then
php artisan migrate --force
fi
Update your script
Add php artisan config:cache
cd /home/forge/www.xponent.com.bd
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader
composer dump-autoload
php artisan cache:clear
php artisan config:cache
echo "" | sudo -S service php7.2-fpm reloadif [ -f artisan ]
then
php artisan migrate --force
fi
Please run below command:
php artisan config:cache
php artisan cache:clear
php artisan view:clear
php artisan route:clear
Related
I'm working on a script to start the laravel project from a github repo.
start cmd /c "mysqld" mysqld --log_syslog=0 --console
cd ./html/BackendAPI/
composer install --no-interaction
php artisan key:generate --no-interaction
php artisan migrate:fresh --seed --no-interaction
But the console closes after the composer install.
Any idea how to do it?
Use call to run composer install command
Like below
start cmd /c "mysqld" mysqld --log_syslog=0 --console
cd ./html/BackendAPI/
call composer install --no-interaction
php artisan key:generate --no-interaction
php artisan migrate:fresh --seed --no-interaction
I wanted to change the app.name of my Laravel project, I run:
php artisan app:name Retro
But have error:
Fatal error: Uncaught ReflectionException: Class Retro\Console\Kernel does >not exist in C:\photo->storage\vendor\laravel\framework\src\Illuminate\Container\Container.php:779
Then, I edited APP_NAME = Retro, and run:
php artisan config:clear
But it not working
Try this
After update App name
php artisan app:name myname
Follow this commands
php artisan cache:clear
php artisan config:clear
composer dump-autoload
What Composer and Artisan commands are necessary to run during deployment of a brand new Laravel application? Per Laravel 5.7 documentation, are these the only essential commands?
composer install --optimize-autoloader --no-dev
php artisan config:cache
php artisan route:cache
Methods are:
composer install --optimize-autoloader --no-dev
composer dump-autoload
The others are optional.
Do you cache your configs? If yes, include php artisan config:cache
Do you cache your routes? If yes, include php artisan route:cache
Do you cache your views? If yes, include php artisan view:cache
Do you want to flush your app cache every time you deploy? If yes, include php artisan cache:clear
Beware that flushing your app cache could have many undesirable effects, especially if you're using your cache system for sessions, queues, etc. as it would clear out everything
post-update-cmd: Illuminate\Foundation\ComposerScripts::postUpdate
post-update-cmd: php artisan ide-helper:generate
Executing command (CWD): php artisan ide-helper:generate
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined method Illuminate\Database\Connection::resolverFor()
Script php artisan ide-helper:generate handling the post-update-cmd event returned with error code 1
Try Using this command in cmd for faster composer install or update
// unix
php -m | grep xdebug
// windows
php -m | findstr xdebug
composer install --prefer-dist -vvv --profile
composer update --prefer-dist -vvv --profile
I just installed Laravel 5.4.* and I have error when I execute this command:
php artisan vendor:publish
vagrant#homestead:~/projects/xxxx_com$ php artisan vendor:publish
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'League\Flysystem\MountManager' not found
vagrant#homestead:~/projects/xxxx_com$
Have you got an idea?
Probably you added new package to composer.json but you haven't run composer install. So make sure you run:
composer install
and after that run
php artisan vendor:publish
You might need to update your composer, run composer update
and see if that help.