Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear cache in Laravel?

Tags:

php

laravel

I have added css file in master-blade.php like this

   <link href="{{ url(mix('css/app.css')) }}" rel="stylesheet">

In view the path of css file looks like this.

    <link href="******/css/app.css?id=43965480df345823e8e0" rel="stylesheet">

Now i am changing the css in app.css file but it does not reflect on web page.The problem is due to the id in path of css file. How can i do the changes in css file.

like image 753
Er. Mukesh Sharma Avatar asked Jan 24 '18 10:01

Er. Mukesh Sharma


People also ask

Where is cache file in Laravel?

Laravel provides a unified API for various caching systems. The cache configuration is located at app/config/cache. php . In this file you may specify which cache driver you would like used by default throughout your application.

How does Laravel manage cache?

Your application's cache configuration file is located at config/cache.php . In this file, you may specify which cache driver you would like to be used by default throughout your application. Laravel supports popular caching backends like Memcached, Redis, DynamoDB, and relational databases out of the box.

What is cache memory in Laravel?

By default, Laravel is configured to use the file cache driver, which stores the serialized, cached objects in the filesystem. For larger applications, it is recommended that you use an in-memory cache such as Memcached or APC. You may even configure multiple cache configurations for the same driver.


2 Answers

You need to run npm run dev on your development server and npm run prod on your production server, to generate/update the JS and CSS.

If you want clear all cache, stored in /storage/cache:

php artisan cache:clear

And to clear route cache:

php artisan route:clear

To clear view cache:

php artisan view:clear
like image 50
Milan Chheda Avatar answered Oct 19 '22 15:10

Milan Chheda


try artisan command-

php artisan cache:clear
php artisan view:clear
like image 1
Sohel0415 Avatar answered Oct 19 '22 17:10

Sohel0415