<?php

namespace App\Console\Commands;

use App\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;

class CreateNewUser extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'create:new-user';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Execute the console command.
     */
    public function handle()
    {
        try {
            User::create([
                'name' => 'Npontu Technologies',
                'email' => 'admin@npontu.com',
                'password' => Hash::make('password')
            ]);
            echo 'User created successfully';
        } catch (\Throwable $th) {
            echo $th->getMessage();
        }
    }
}
