From 814bbb2e82e8e19be12188ed00411e1132ef0024 Mon Sep 17 00:00:00 2001 From: Jan Henk Hazelaar Date: Tue, 5 Nov 2024 12:34:17 +0100 Subject: [PATCH] Add site database table exists --- src/Sites/Sites.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Sites/Sites.php b/src/Sites/Sites.php index c0048cfc..01820ec9 100644 --- a/src/Sites/Sites.php +++ b/src/Sites/Sites.php @@ -3,11 +3,17 @@ namespace Statamic\Eloquent\Sites; use Statamic\Support\Str; +use Illuminate\Support\Facades\Schema; class Sites extends \Statamic\Sites\Sites { protected function getSavedSites() { + $sitesTable = config('statamic.eloquent-driver.table_prefix', '').'entries'; + if(! Schema::hasTable($sitesTable)) { + return $this->getFallbackConfig(); + }; + $sites = app('statamic.eloquent.sites.model')::all(); return $sites->isEmpty() ? $this->getFallbackConfig() : $sites->mapWithKeys(function ($model) {