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
Related
On localhost every thing work okay but when I try to deploy laravel project to heroku I get this error:
message "In order to use the Auth::routes() method, please install the laravel/ui package"
I have tried the next things to fix this error but they are not working for me
composer require laravel/ui
php artisan ui bootstrap --auth
php artisan cache:clear
php artisan config:cache
php artisan route:cache
Manually clear the .php files within the bootstrap/cache folder and then php artisan config:cache.
And all of this solutions didn't work for me
Which version of laravel/ui are you trying to install? The newest - 4.x at the time of writing, is not compatible with Laravel 8. So you want to install 3.x for a version that supports Laravel 8.
composer require laravel/ui:^3.0
I have a big problem. I tried to use Tailwind in a new Laravel project following exactly all the documentation but as soon as I try to put the <link> to the css/app.css the HTML just stop working in the browser (localhost).
I tried also starting a new Laravel project with JetStream, but it does the same thing.
I also tried installing an older version of Tailwind but nothing seems to work.
I don't really know what to search for at this point.
Any help?
you can use tailwindCss in laravel with breeze package or Jetstream
1- with Breeze:
//composer package
composer require laravel/breeze --dev
then
php artisan breeze:install
Or Breeze with Inertia
php artisan breeze:install --inertia
Finalizing The Installation
npm install
npm run dev
php artisan migrate
2- with Jetstream
//composer package
composer require laravel/jetstream
Install Jetstream With Livewire
php artisan jetstream:install livewire
php artisan jetstream:install livewire --teams
Or, Install Jetstream With Inertia
php artisan jetstream:install inertia
php artisan jetstream:install inertia --teams
Finalizing The Installation
npm install
npm run dev
php artisan migrate
I start a new project in laravel but my composer installed a fresh version of laravel 6.0.1.
Php artisan make:auth command can't work.
I try many times but error can't remove
composer require laravel/ui
installed but
when I use the second command:
php artisan ui vue --auth
then system show me this message:
Command "ui" is not defined.
Using version ^1.0 for laravel/ui
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSetGenerator.php on line 129
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSetGenerator.php on line 129
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
you can try this:
C:\Whatever\Your_project_name>composer require laravel/ui
and
C:\Whatever\Your_project_name>php artisan ui vue --auth
Just this two inside your project folder.I am using vue but you can try other ones too.
Did you install the dependency? To run that command you need to install an additional package:
composer require laravel/ui
After this you should be able to run one of these commands:
php artisan ui bootstrap
php artisan ui vue
php artisan ui react
In case you need the auth views, you could:
php artisan ui bootstrap --auth
php artisan ui vue --auth
php artisan ui react --auth
Don't forget to run this after:
npm install
The same error hits me in the new version of Laravel 7.x, What I did the process is really simple: if your composer is old version and the terminal or cmd is giving you warnings to update it using some package then there are chances that the above error hits you.
Solution:
Step 1 : Try the following two commands in your normal terminal not of your project directory. The below command will only update the composer.
composer self-update
OR use the below command (it will update your dependencies plus your composer)
composer update
When you composer gets updated. check the composer by the below command
composer --version
Step 2 : First go to your project root folder C:\Whatever\Your_project_name>
composer require laravel/ui
Try any of the below command according to your front end framework.
php artisan ui vue --auth
php artisan ui bootstrap --auth
php artisan ui react --auth
At the end don't forget to run
npm install
If your User Interface is not working properly try below command.
npm run production
run "composer require laravel/ui 1" instead of "composer require laravel/ui"
laravel 6 works with version 1.0, it written in docs "Want to get started fast? Install the laravel/ui (1.0)"
I was facing the same issue is laravel 8.0, whenever i tried to run this command
php artisan ui vue -auth
after installing the laravel/ui package I was getting the error
command UI is not defined
I fixed this issue by using this command
composer update
it automatically install the laravel/ui package into my project and then I run this command to install the required auth for my web app.
`php artisan ui vue -auth`
You need to create another new project.
You can try this:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
composer create-project --prefer-dist laravel/laravel project2 "7.0.*"
composer require laravel/ui
php artisan ui vue --auth
Just add the version in command line as well:
composer require laravel/ui "^1.0" --dev
Check this too.
using
composer require laravel/ui:*
worked for me
I recently faced this issue after upgrading from laravel 6 to 8. Installing laravel/ui did not work for me because the package was already installed.
I solved it by manually deleting cache folder at bootstrap/cache
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
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.