Restrict active rides to last 12 hours

This commit is contained in:
Hamza-Ayed
2026-04-24 00:18:27 +03:00
parent 3f4b4ef659
commit e78bfc6b5c

View File

@@ -53,7 +53,8 @@ class Ride extends Model
public function scopeActive($query) public function scopeActive($query)
{ {
return $query->whereIn('status', ['waiting', 'wait', 'Apply', 'Applied', 'Arrived', 'Begin']); return $query->whereIn('status', ['waiting', 'wait', 'Apply', 'Applied', 'Arrived', 'Begin'])
->where('created_at', '>=', now()->subHours(1));
} }
public function scopeForPassenger($query, string $passengerId) public function scopeForPassenger($query, string $passengerId)