Car-Repairs-Shop/app/Console/Commands/CheckUserDetails.php
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

60 lines
1.9 KiB
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
class CheckUserDetails extends Command
{
protected $signature = 'check:user {email}';
protected $description = 'Check user details by email';
public function handle()
{
$email = $this->argument('email');
$user = User::where('email', $email)->first();
if (!$user) {
$this->error("User with email {$email} not found");
return;
}
$this->info("User Details:");
$this->info("Name: {$user->name}");
$this->info("Email: {$user->email}");
$this->info("ID: {$user->id}");
$this->info("Status: {$user->status}");
$this->info("Password Hash: " . substr($user->password, 0, 30) . "...");
$this->info("Created: {$user->created_at}");
$this->info("Updated: {$user->updated_at}");
// Check customer relationship
$customer = $user->customer;
if ($customer) {
$this->info("Customer ID: {$customer->id}");
$this->info("Customer Name: {$customer->first_name} {$customer->last_name}");
$this->info("Customer Created: {$customer->created_at}");
} else {
$this->info("No associated customer found");
}
// Test a few common passwords
$testPasswords = ['test123', 'password', 'password123', '123456', 'admin123'];
$this->info("\nTesting common passwords:");
foreach ($testPasswords as $password) {
if (Hash::check($password, $user->password)) {
$this->info("✅ Password '{$password}' matches!");
return;
} else {
$this->line("❌ Password '{$password}' does not match");
}
}
$this->info("\nNone of the common passwords match.");
}
}