Fix Pint formatting
This commit is contained in:
@@ -16,19 +16,19 @@ class EventListService
|
||||
$activeOnly = $filters['active'] ?? null;
|
||||
|
||||
$allowedSorts = ['created_at', 'expiration_date', 'event_name'];
|
||||
if (!in_array($sortBy, $allowedSorts, true)) {
|
||||
if (! in_array($sortBy, $allowedSorts, true)) {
|
||||
$sortBy = 'created_at';
|
||||
}
|
||||
|
||||
$query = Event::query();
|
||||
|
||||
if (!empty($filters['school_year'])) {
|
||||
if (! empty($filters['school_year'])) {
|
||||
$query->where('school_year', (string) $filters['school_year']);
|
||||
}
|
||||
if (!empty($filters['semester'])) {
|
||||
if (! empty($filters['semester'])) {
|
||||
$query->where('semester', (string) $filters['semester']);
|
||||
}
|
||||
if (!empty($filters['q'])) {
|
||||
if (! empty($filters['q'])) {
|
||||
$term = trim((string) $filters['q']);
|
||||
$query->where('event_name', 'like', "%{$term}%");
|
||||
}
|
||||
@@ -67,10 +67,10 @@ class EventListService
|
||||
private function activeCount(array $filters): int
|
||||
{
|
||||
$query = Event::query()->whereDate('expiration_date', '>=', now()->toDateString());
|
||||
if (!empty($filters['school_year'])) {
|
||||
if (! empty($filters['school_year'])) {
|
||||
$query->where('school_year', (string) $filters['school_year']);
|
||||
}
|
||||
if (!empty($filters['semester'])) {
|
||||
if (! empty($filters['semester'])) {
|
||||
$query->where('semester', (string) $filters['semester']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user