Skip to content

Commit dbafc81

Browse files
committed
website_id check moved to content model
1 parent 5208b90 commit dbafc81

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Http/Controller/ContentController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ContentController extends Controller
1010
{
1111
public function index()
1212
{
13-
$content = Content::where('website_id', env('WEBSITE_ID'))->indexPage();
13+
$content = Content::indexPage();
1414

1515
return view("pages.{$content->contentTemplate->name}", ['content' => $content]);
1616
}

src/Models/Content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function parent()
4747
*/
4848
public static function indexPage()
4949
{
50-
return self::whereNull('parent_id')->orderBy('position', 'ASC')->first();
50+
return self::where('website_id', env('WEBSITE_ID'))->whereNull('parent_id')->orderBy('position', 'ASC')->first();
5151
}
5252

5353
/**

0 commit comments

Comments
 (0)