Skip to content
Merged

Dev #3516

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/Nova/CsrCampaignPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ public static function uriKey(): string

public static function indexQuery(NovaRequest $request, $query)
{
return $query->where('id', 1);
if (!\Illuminate\Support\Facades\Schema::hasTable('csr_campaign_page')) {
return $query->whereRaw('1 = 0');
}

$page = \App\CsrCampaignPage::config();

return $query->where('id', $page->id);
}

public static function authorizedToCreate(Request $request): bool
Expand Down
8 changes: 7 additions & 1 deletion app/Nova/DancePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ public static function uriKey(): string

public static function indexQuery(NovaRequest $request, $query)
{
return $query->where('id', 1);
if (!\Illuminate\Support\Facades\Schema::hasTable('dance_page')) {
return $query->whereRaw('1 = 0');
}

$page = \App\DancePage::config();

return $query->where('id', $page->id);
}

public static function authorizedToCreate(Request $request): bool
Expand Down
16 changes: 14 additions & 2 deletions app/Nova/GetInvolvedPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,24 @@ public static function authorizedToViewAny(Request $request): bool

public static function indexQuery(NovaRequest $request, $query)
{
return $query->where('id', 1);
if (!\Illuminate\Support\Facades\Schema::hasTable('get_involved_page')) {
return $query->whereRaw('1 = 0');
}

$page = \App\GetInvolvedPage::config();

return $query->where('id', $page->id);
}

public static function relatableQuery(NovaRequest $request, $query)
{
return $query->where('id', 1);
if (!\Illuminate\Support\Facades\Schema::hasTable('get_involved_page')) {
return $query->whereRaw('1 = 0');
}

$page = \App\GetInvolvedPage::config();

return $query->where('id', $page->id);
}

public static function authorizedToCreate(Request $request): bool
Expand Down
8 changes: 7 additions & 1 deletion app/Nova/OnlineCoursesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ public static function uriKey(): string

public static function indexQuery(NovaRequest $request, $query)
{
return $query->where('id', 1);
if (!\Illuminate\Support\Facades\Schema::hasTable('online_courses_page')) {
return $query->whereRaw('1 = 0');
}

$page = \App\OnlineCoursesPage::config();

return $query->where('id', $page->id);
}

public static function authorizedToCreate(Request $request): bool
Expand Down
8 changes: 7 additions & 1 deletion app/Nova/TreasureHuntPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ public static function uriKey(): string

public static function indexQuery(NovaRequest $request, $query)
{
return $query->where('id', 1);
if (!\Illuminate\Support\Facades\Schema::hasTable('treasure_hunt_page')) {
return $query->whereRaw('1 = 0');
}

$page = \App\TreasureHuntPage::config();

return $query->where('id', $page->id);
}

public static function authorizedToCreate(Request $request): bool
Expand Down
Loading