sackey cbae4564b9
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
Add customer portal views for dashboard, estimates, invoices, vehicles, and work orders
- Implemented dashboard view with vehicle stats, active services, recent activity, and upcoming appointments.
- Created estimates view with filtering options and a list of service estimates.
- Developed invoices view to manage service invoices and payment history with filtering.
- Added vehicles view to display registered vehicles and their details.
- Built work orders view to track the progress of vehicle services with filtering and detailed information.
2025-08-08 09:56:26 +00:00

53 lines
1.5 KiB
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
class TestUserAuth extends Command
{
protected $signature = 'test:user-auth {email} {password}';
protected $description = 'Test user authentication with given credentials';
public function handle()
{
$email = $this->argument('email');
$password = $this->argument('password');
$user = User::where('email', $email)->first();
if (!$user) {
$this->error("User with email {$email} not found!");
return 1;
}
$this->info("User found: {$user->name} ({$user->email})");
$this->info("User ID: {$user->id}");
$this->info("User Status: {$user->status}");
$this->info("Password Hash: " . substr($user->password, 0, 30) . "...");
// Test password
if (Hash::check($password, $user->password)) {
$this->info("✅ Password matches!");
} else {
$this->error("❌ Password does NOT match!");
}
// Check roles
$roles = $user->roles->pluck('name');
$this->info("Roles: " . $roles->join(', '));
// Test if user can login
if (auth()->attempt(['email' => $email, 'password' => $password])) {
$this->info("✅ Authentication successful!");
auth()->logout();
} else {
$this->error("❌ Authentication failed!");
}
return 0;
}
}