feat: add admin generator command

This commit is contained in:
2026-08-16 16:56:43 +03:30
parent e9f75f1337
commit 497aa161a7
@@ -0,0 +1,43 @@
<?php
namespace App\Console\Commands;
use App\Enums\AdminStatus;
use App\Models\Admin;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;
class AdminGeneratorCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:admin-generator';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Create default admin user';
/**
* Execute the console command.
*/
public function handle()
{
Admin::create([
'full_name' => 'مدیر سیستم',
'username' => 'admin',
'email' => 'admin@gmail.com',
'mobile' => '09123456789',
'password' => Hash::make('123456789'),
'status' => AdminStatus::ENABLE,
]);
$this->info('Admin created successfully.');
}
}