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

40 lines
1.1 KiB
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
class ResetUserPassword extends Command
{
protected $signature = 'reset:password {email} {password}';
protected $description = 'Reset user password';
public function handle()
{
$email = $this->argument('email');
$newPassword = $this->argument('password');
$user = User::where('email', $email)->first();
if (!$user) {
$this->error("User with email {$email} not found");
return;
}
$user->password = Hash::make($newPassword);
$user->save();
$this->info("Password reset successfully for {$user->name} ({$email})");
$this->info("New password: {$newPassword}");
// Test the new password immediately
if (Hash::check($newPassword, $user->fresh()->password)) {
$this->info("✅ Password verification successful!");
} else {
$this->error("❌ Password verification failed!");
}
}
}