Restrict active rides to last 12 hours
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user