Skip to content

Commit 3c4e7de

Browse files
committed
qc changes
1 parent 4d6c057 commit 3c4e7de

5 files changed

Lines changed: 42 additions & 6 deletions

File tree

app/Nova/CsrCampaignPage.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ public static function uriKey(): string
3434

3535
public static function indexQuery(NovaRequest $request, $query)
3636
{
37-
return $query->where('id', 1);
37+
if (!\Illuminate\Support\Facades\Schema::hasTable('csr_campaign_page')) {
38+
return $query->whereRaw('1 = 0');
39+
}
40+
41+
$page = \App\CsrCampaignPage::config();
42+
43+
return $query->where('id', $page->id);
3844
}
3945

4046
public static function authorizedToCreate(Request $request): bool

app/Nova/DancePage.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ public static function uriKey(): string
3333

3434
public static function indexQuery(NovaRequest $request, $query)
3535
{
36-
return $query->where('id', 1);
36+
if (!\Illuminate\Support\Facades\Schema::hasTable('dance_page')) {
37+
return $query->whereRaw('1 = 0');
38+
}
39+
40+
$page = \App\DancePage::config();
41+
42+
return $query->where('id', $page->id);
3743
}
3844

3945
public static function authorizedToCreate(Request $request): bool

app/Nova/GetInvolvedPage.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,24 @@ public static function authorizedToViewAny(Request $request): bool
4242

4343
public static function indexQuery(NovaRequest $request, $query)
4444
{
45-
return $query->where('id', 1);
45+
if (!\Illuminate\Support\Facades\Schema::hasTable('get_involved_page')) {
46+
return $query->whereRaw('1 = 0');
47+
}
48+
49+
$page = \App\GetInvolvedPage::config();
50+
51+
return $query->where('id', $page->id);
4652
}
4753

4854
public static function relatableQuery(NovaRequest $request, $query)
4955
{
50-
return $query->where('id', 1);
56+
if (!\Illuminate\Support\Facades\Schema::hasTable('get_involved_page')) {
57+
return $query->whereRaw('1 = 0');
58+
}
59+
60+
$page = \App\GetInvolvedPage::config();
61+
62+
return $query->where('id', $page->id);
5163
}
5264

5365
public static function authorizedToCreate(Request $request): bool

app/Nova/OnlineCoursesPage.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ public static function uriKey(): string
3333

3434
public static function indexQuery(NovaRequest $request, $query)
3535
{
36-
return $query->where('id', 1);
36+
if (!\Illuminate\Support\Facades\Schema::hasTable('online_courses_page')) {
37+
return $query->whereRaw('1 = 0');
38+
}
39+
40+
$page = \App\OnlineCoursesPage::config();
41+
42+
return $query->where('id', $page->id);
3743
}
3844

3945
public static function authorizedToCreate(Request $request): bool

app/Nova/TreasureHuntPage.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ public static function uriKey(): string
3333

3434
public static function indexQuery(NovaRequest $request, $query)
3535
{
36-
return $query->where('id', 1);
36+
if (!\Illuminate\Support\Facades\Schema::hasTable('treasure_hunt_page')) {
37+
return $query->whereRaw('1 = 0');
38+
}
39+
40+
$page = \App\TreasureHuntPage::config();
41+
42+
return $query->where('id', $page->id);
3743
}
3844

3945
public static function authorizedToCreate(Request $request): bool

0 commit comments

Comments
 (0)