35 lines
781 B
PHP
35 lines
781 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Console\Commands;
|
||
|
|
||
|
use Illuminate\Console\Command;
|
||
|
use Modules\User\Repositories\PermissionRepository;
|
||
|
use Spatie\Permission\Models\Permission;
|
||
|
|
||
|
class GeneratePermissions extends Command
|
||
|
{
|
||
|
/**
|
||
|
* The name and signature of the console command.
|
||
|
*
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $signature = 'permissions:generate';
|
||
|
|
||
|
/**
|
||
|
* The console command description.
|
||
|
*
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $description = 'Generate Permissions From Named Route';
|
||
|
|
||
|
/**
|
||
|
* Execute the console command.
|
||
|
*/
|
||
|
public function handle(): void
|
||
|
{
|
||
|
$this->info('Generating Permissions');
|
||
|
PermissionRepository::generatePermissionFromRoutes();
|
||
|
$this->info('Permissions generated successfully!');
|
||
|
}
|
||
|
}
|