<?php

use App\Models\User;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;

Artisan::command('inspire', function () {
    $this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote')->hourly();

Artisan::command('register', function () {
    $this->warn('Registering or Re-registering for an admin account will wipe all other user\'s data. Are you sure you want to do this?');
    if (!$this->confirm('Do you want to proceed?')) return;

    $name = $this->ask('Admin Name');
    $email = $this->ask('Admin Email Address');
    $password = $this->ask('Admin Password');

    User::truncate();
    User::create(compact('name', 'email', 'password'));
});
