We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44083f4 commit 78122eaCopy full SHA for 78122ea
src/Commands/CacheReset.php
@@ -13,9 +13,12 @@ class CacheReset extends Command
13
14
public function handle()
15
{
16
- if (app(PermissionRegistrar::class)->forgetCachedPermissions()) {
+ $permissionRegistrar = app(PermissionRegistrar::class);
17
+ $cacheExists = $permissionRegistrar->getCacheRepository()->has($permissionRegistrar->cacheKey);
18
+
19
+ if ($permissionRegistrar->forgetCachedPermissions()) {
20
$this->info('Permission cache flushed.');
- } else {
21
+ } else if ($cacheExists) {
22
$this->error('Unable to flush cache.');
23
}
24
0 commit comments