-
app/Console/Commands/AdminCommand.php
Open in GitHubuse App\Models\Auth\Admin; use Illuminate\Console\Command; use Illuminate\Support\Facades\Hash; class AdminCommand extends Command { protected $signature = 'create:admin'; protected $description = 'Create a new admin'; public function __construct() { parent::__construct(); } public function handle() { $name = $this->ask('Name'); $email = $this->ask('Email Address'); $password = $this->secret('Password'); Admin::create([ 'email' => $email, 'name' => $name, 'password' => Hash::make($password), ]); $this->info('User created successfully.'); } }