Ebook: List of The Artisan Commands in Laravel 6
Ebook: List of The Artisan Commands in Laravel 6
Ebook: List of The Artisan Commands in Laravel 6
Table of Contents
● php artisan route:clear
● php artisan route:cache
● php artisan config:clear
● php artisan config:cache
● php artisan cache:clear
● php artisan view:clear
● php artisan view:cache
● php artisan optimize
● php artisan serve
● Conclusion
Whenever you add new config file or change existing config file in App/config directory, laravel will not take latest
change by default rather we need to clear the cached config file, php artisan config:clear does the same thing for us.
php artisan config:cache
This command clears the cached config file as mentioned above and recaches the latest configurations into a single
file again.
So if you have made any changes into blade files and they are not reflecting in browser, most probably latest
changes might have not been cached hence run this command to clear the view caches.
php artisan view:cache
This command serves the same purpose as above but additionally, it auto caches the latest view / blade file
changes.
App/config/app.php :
APP_NAME=AWESOME_APP
‘name’ variable first attempts to take value from the .env file where the key is APP_NAME and if there is no key as
APP_NAME then it will take default values as Laravel.
If we change APP_NAME value in .env file something like APP_NAME=MAGNIFICENT_APP, now ‘name’ variable
will still be as AWESOME_APP until we stop the laravel application and re-run using
Conclusion
In this article we discussed about various caching mechanisms laravel provides though artisan commands like
route:clear, route:cache, config:clear, config:cache, view:clear etc.