StocksNew/app/Console/Commands/GeneratePermissions.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

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!');
}
}