git commit "fix user panel pages hero layout and add profile dropdown improvements"
This commit is contained in:
+5
-10
@@ -81,17 +81,12 @@ class Flight extends Model
|
||||
public function applySearch(Builder $query, array $filters): void
|
||||
{
|
||||
$query
|
||||
->when($filters['origin'] ?? null, function ($query, $origin) {
|
||||
$query->where('origin', $origin);
|
||||
->when($filters['origin'] ?? null, function($query,$origin){
|
||||
$query->where('origin',$origin);
|
||||
})
|
||||
->when($filters['destination'] ?? null, function ($query, $destination) {
|
||||
$query->where('destination', $destination);
|
||||
})
|
||||
->when($filters['departure_date'] ?? null, function ($query, $date) {
|
||||
$query->whereDate('departure_date', $date);
|
||||
})
|
||||
->when($filters['passengers'] ?? null, function ($query, $passengers) {
|
||||
$query->where('capacity', '>=', $passengers);
|
||||
|
||||
->when($filters['destination'] ?? null, function($query,$destination){
|
||||
$query->where('destination',$destination);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user