简体   繁体   English

持续清理 Laravel 缓存,特别是针对 package spatie/laravel-permission

[英]Continuous cleaning of Laravel cache especially for the package spatie/laravel-permission

I have a problem with Laravel cache, When I add/change the route or change the roles in the spatie/laravel-permission package, I must clear the cache, Is there a solution to this issue?我的 Laravel 缓存有问题,当我添加/更改路由或更改 spatie/laravel-permission package 中的角色时,我必须清除缓存,是否有解决此问题的方法?

By default, it is set to 24 hours.默认情况下,它设置为 24 小时。

You can change it in the config/permissions.php file.您可以在 config/permissions.php 文件中更改它。

The default cache expiration_time is 24 hours.默认缓存过期时间为 24 小时。 If you wish to alter the expiration time you may do so in the config/permission.php file, in the cache array.如果您希望更改过期时间,您可以在缓存阵列中的 config/permission.php 文件中进行。

https://spatie.be/docs/laravel-permission/v5/advanced-usage/cache https://spatie.be/docs/laravel-permission/v5/advanced-usage/cache

You can run these cache removing commands from your controller.您可以从 controller 运行这些缓存删除命令。

Artisan::call("cache:forget spatie.permission.cache"); 
Artisan::call("cache:clear");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM