<?php

namespace App\Livewire\Buttons;

use Livewire\Component;

class CreateUser extends Component
{
    public $username, $first_name, $last_name, $email, $status = 'active', $role = 'admin', $default_password;

    public function generatePassword()
    {
        $this->default_password = bin2hex(random_bytes(4));
    }

    public function submit()
    {
        return redirect()->to('/main/user-management');
    }
    
    public function cancel()
    {
        return redirect()->to('/main/user-management');
    }

    public function render()
    {
        return view('livewire.buttons.create-user');
    }
}


