如何清除 Laravel 中的缓存?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48419624/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to clear cache in Laravel?
提问by Er. Mukesh Sharma
I have added css file in master-blade.php like this
我在 master-blade.php 中添加了这样的 css 文件
<link href="{{ url(mix('css/app.css')) }}" rel="stylesheet">
In view the path of css file looks like this.
鉴于 css 文件的路径是这样的。
<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.
现在我正在更改 app.css 文件中的 css,但它没有反映在网页上。问题是由于 css 文件路径中的 id。我该如何更改 css 文件。
回答by Milan Chheda
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.
您需要npm run dev
在开发服务器和npm run prod
生产服务器上运行,以生成/更新 JS 和 CSS。
If you want clear all cache, stored in /storage/cache:
如果要清除存储在 /storage/cache 中的所有缓存:
php artisan cache:clear
And to clear route cache:
并清除路由缓存:
php artisan route:clear
To clear view cache:
清除视图缓存:
php artisan view:clear
回答by Sohel0415
try artisan command-
尝试工匠命令-
php artisan cache:clear
php artisan view:clear
回答by Alexey Mezenin
If you want to clear view cache, do this:
如果要清除视图缓存,请执行以下操作:
php artisan view:clear
You also can clear all Laravel cache.
您也可以清除所有 Laravel 缓存。
回答by DevonDahon
This command clears all cache:
此命令清除所有缓存:
php artisan optimize:clear