Heera/app/Console/Commands/GeneratePermissions.php

35 lines
781 B
PHP
Raw Normal View History

2024-05-16 03:46:08 +00:00
<?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!');
}
}