File "CacheReset.php"
Full path: /home/orbitecv/orbite-school.orbit.et/vendor/spatie/laravel-permission/src/Commands/CacheReset.php
File size: 696 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Edit Back
<?php
namespace Spatie\Permission\Commands;
use Illuminate\Console\Command;
use Spatie\Permission\PermissionRegistrar;
class CacheReset extends Command
{
protected $signature = 'permission:cache-reset';
protected $description = 'Reset the permission cache';
public function handle()
{
$permissionRegistrar = app(PermissionRegistrar::class);
$cacheExists = $permissionRegistrar->getCacheRepository()->has($permissionRegistrar->cacheKey);
if ($permissionRegistrar->forgetCachedPermissions()) {
$this->info('Permission cache flushed.');
} elseif ($cacheExists) {
$this->error('Unable to flush cache.');
}
}
}