The scenario is I have developed a Laravel app in my localhost. Everything works fine. Now I need to make it go online. I am just trying to figure out what steps (configuration , security etc.) should I take before I make it go online.
I am listing a few steps:
1) Change in .env
file to make the environment point to production mode using APP_ENV=production
.
2) Avoide showing errors directly in pages as that would expose the innards of the app. Enable error logging instead.
3) Use caching for faster user experience 4) building a nice 404, not found page
What else should I undertake to turn the app from development mode into production mode ?
BBC, which is the oldest broadcasting organization and the largest broadcaster in the world by the number of employees, is one of the most prominent examples. A few other big companies using Laravel includes 9GAG, Pfizer, TourRadar, and Crowdcube.
You can manage and create any number of storefronts, including apps and devices, using the Laravel eCommerce GraphQL-based Rest API. It decouples a website's front-end from its back-end, allowing developers to use any front-end technology of their choice, such as javascript frameworks such as react.
.env
file:
APP_ENV=production
APP_DEBUG=false
composer dump-autoload --optimize
composer install --optimize-autoloader --no-dev
composer update --optimize-autoloader
Optimizing Configuration Loading:
php artisan config:cache
Optimizing Route Loading
php artisan route:cache
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):
public/storage
to storage/app/public
(docs):
php artisan storage:link
There are some steps you can check
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