# Password Hash Generator - Quick Guide

## Methods to Generate Password Hashes

### Method 1: Simple PHP Script (Fastest)
```bash
php generate_hash.php
```
This will prompt you to enter a password and generate a bcrypt hash.

### Method 2: Using Console Command
```bash
php artisan password:hash
```
Or with password as argument:
```bash
php artisan password:hash "your-password-here"
```

### Method 3: PowerShell One-Liner
```powershell
php -r "echo password_hash('your-password', PASSWORD_BCRYPT) . PHP_EOL;"
```

## Quick Admin Login Setup

### Default Admin Credentials
The system comes with a pre-configured admin user:
- **Username:** `admin`
- **Password:** `admin123`
- **Hash:** `$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi`

### Create/Update Admin User

**Option 1: Run SQL Script**
```bash
mysql -u your_user -p your_database < database/seeders/create_admin.sql
```

**Option 2: Direct SQL Command**
```sql
UPDATE users 
SET password = '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi'
WHERE username = 'admin';
```

**Option 3: PowerShell (Windows)**
```powershell
# Generate a new hash
$password = "your-new-password"
$hash = php -r "echo password_hash('$password', PASSWORD_BCRYPT);"
Write-Host "Hash: $hash"
```

## Example Usage

### Generate hash for a new password:
```bash
cd c:\Users\admin\Downloads\EFL
php generate_hash.php
```

Output:
```
========================================
      Password Hash Generator
========================================

Enter password: [type your password]

Password hash generated successfully!

Hash:
----------------------------------------
$2y$10$abcdefghijklmnopqrstuvwxyz123456789...
----------------------------------------
```

### Then update the database:
```sql
UPDATE users 
SET password = '$2y$10$abcdefghijklmnopqrstuvwxyz123456789...'
WHERE username = 'admin';
```

## Common Passwords (Hashed)

For testing purposes:

| Password  | Hash |
|-----------|------|
| admin123  | `$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi` |
| password  | `$2y$10$W7zsFTxL7D3qVqYn8xJbKuGH6l9vPF9EQCmSZ5qFhF.vR7X8o9Cqm` |
| test123   | `$2y$10$ZKqJ9FbR7yyH5qGWfL5DFehqJ8QVwPQ.2XF9Y3bX/gR5F7L9Q3dKe` |

## Security Note

⚠️ **Important:** Change the default admin password immediately after first login!

The default password `admin123` is only for initial setup and should be changed to a strong, unique password.
