Skip to content

Commit 9b3e620

Browse files
committed
query() call added
1 parent 57358ca commit 9b3e620

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Http/Controllers/JsonController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class JsonController extends BasePublicController
1010
{
1111
public function index(): JsonResponse
1212
{
13-
$institutions = Place::published()->get()->map(function ($item) {
13+
$institutions = Place::query()->published()->get()->map(function ($item) {
1414
$item->url = $item->url();
1515

1616
return $item;
@@ -21,7 +21,7 @@ public function index(): JsonResponse
2121

2222
public function show(string $slug): JsonResponse
2323
{
24-
$institution = Place::published()->whereSlugIs($slug)->firstOrFail();
24+
$institution = Place::query()->published()->whereSlugIs($slug)->firstOrFail();
2525

2626
return response()->json($institution);
2727
}

src/Http/Controllers/PublicController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class PublicController extends BasePublicController
1010
{
1111
public function index(): View
1212
{
13-
$models = Place::published()
13+
$models = Place::query()
14+
->published()
1415
->order()
1516
->with('image')
1617
->get();
@@ -21,7 +22,7 @@ public function index(): View
2122

2223
public function show(string $slug): View
2324
{
24-
$model = Place::published()->whereSlugIs($slug)->firstOrFail();
25+
$model = Place::query()->published()->whereSlugIs($slug)->firstOrFail();
2526

2627
return view('places::public.show')
2728
->with(compact('model'));

0 commit comments

Comments
 (0)