fix: remove duplicate opening brace in ServiceController index method
This commit is contained in:
parent
292ad6b923
commit
5459529c3a
|
|
@ -15,9 +15,18 @@ class ServiceController extends Controller
|
|||
{
|
||||
public function index(): Response
|
||||
{
|
||||
$services = Service::query()
|
||||
->whereDate('date', '>=', Carbon::today())
|
||||
->orderBy('date')
|
||||
$archived = request()->boolean('archived');
|
||||
|
||||
$query = Service::query();
|
||||
if ($archived) {
|
||||
$query->whereDate('date', '<', Carbon::today())
|
||||
->orderByDesc('date');
|
||||
} else {
|
||||
$query->whereDate('date', '>=', Carbon::today())
|
||||
->orderBy('date');
|
||||
}
|
||||
|
||||
$services = $query
|
||||
->withCount([
|
||||
'serviceSongs as songs_total_count',
|
||||
'serviceSongs as songs_mapped_count' => fn ($query) => $query->whereNotNull('song_id'),
|
||||
|
|
@ -59,6 +68,7 @@ public function index(): Response
|
|||
|
||||
return Inertia::render('Services/Index', [
|
||||
'services' => $services,
|
||||
'archived' => $archived,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue