Laravel Clear Cache Using Artisan Command

--

Laravel Artisan Command List

  1. php artisan config:cache
  2. php artisan route:cache
  3. php artisan cache:clear
  4. php artisan view:clear
  • In this tutorial i am giving information about laravel artisan command which can help you to clear you application's cache , route cache , clear your application's view , and clear Your config cache as well as.
  • We can run these all command in commandline interface (CLI) as well as we can create one function which has stored all these function and run direct this function without open your terminal. So,let’s start.

Clear Config Cache

  • This command is used for clear/delete config bootstrap/cache/config.php file of your application.

php artisan config:cache

Clear Route Cache

  • This command is used to clear route cache of your application.

php artisan route:cache

Clear Cache Laravel Application

  • This command is use for clear your application cache :

php artisan cache:clear

Clear View Cache Laravel

  • This command is use to clear view cache of your application.

php artisan view:clear

  • Above all commands are use only in your local command window , As we don't have an access of SSL on shared hosting servers. So, we can also clear the cache by typing the code in route file. Go to your routes/web.php file and put below code.

Click To Read More…

  • After adding above code we can clear all cache , view , route , config in local environments as well as in live server also.
  • For run this route you need to open your browser and after add this route like below.

http://localhost:8000/clear-cache OR http://your_site_name/clear-cache

--

--

Websolutionstuff
Websolutionstuff

Written by Websolutionstuff

I am Laravel and PHP Developer. I have also Good Knowledge of JavaScript, jQuery, Bootstrap and REST API. Visit Website: http://websolutionstuff.com/

No responses yet