Answers for "run laravel production"

PHP
1

laravel production

Apply changes to .env file:
APP_ENV=production
APP_DEBUG=false
Make sure that you are optimizing Composer's class autoloader map (docs):
composer dump-autoload --optimize
or along install: composer install --optimize-autoloader --no-dev
or during update: composer update --optimize-autoloader
Optimizing Configuration Loading:

php artisan config:cache
Optimizing Route Loading

php artisan route:cache
Compile all of the application's Blade templates:
php artisan view:cache
Cache the framework bootstrap files:

php artisan optimize
(Optional) Compiling assets (docs):

npm run production
(Optional) Generate the encryption keys Laravel Passport needs (docs):

php artisan passport:keys
(Optional) Start Laravel task scheduler by adding the following Cron entry (docs):

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
(Optional) Install, config and start the Supervisor (docs):

(Optional) Create a symbolic link from public/storage to storage/app/public (docs):
php artisan storage:link
Laravel deployment docs: https://laravel.com/docs/master/deployment
Digital Ocean's tutorial: How to Install and Configure Laravel
Posted by: Guest on July-05-2021
2

how to run laravel project

Create a database locally named homestead utf8_general_ci
    Download composer https://getcomposer.org/download/
    Pull Laravel/php project from git provider.
    Rename .env.example file to .envinside your project root and fill the database information. (windows wont let you do it, so you have to open your console cd your project root directory and run mv .env.example .env )
    Open the console and cd your project root directory
    Run composer install or php composer.phar install
    Run php artisan key:generate
    Run php artisan migrate
    Run php artisan db:seed to run seeders, if any.
    Run php artisan serve

#####You can now access yo

ur project at localhost:8000 :)
Posted by: Guest on January-31-2021

Browse Popular Code Answers by Language