laravel-alt/routes/console.php
Nasir Hossain Nishad c14d4e4d28 Initial commit
2024-09-23 18:41:36 +06:00

22 lines
700 B
PHP

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