Skip to content

Commit

Permalink
Only show error if cache key exists and forgetCachedPermissions fail
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 authored Aug 22, 2024
1 parent 231530a commit 23d5792
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Commands/CacheReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ class CacheReset extends Command

public function handle()
{
if (app(PermissionRegistrar::class)->forgetCachedPermissions()) {
$permissionRegistrar = app(PermissionRegistrar::class);
$cacheExists = $permissionRegistrar->getCacheRepository()->has($permissionRegistrar->cacheKey);

if ($permissionRegistrar->forgetCachedPermissions()) {
$this->info('Permission cache flushed.');
} else {
} else if ($cacheExists) {
$this->error('Unable to flush cache.');
}
}
Expand Down

0 comments on commit 23d5792

Please sign in to comment.