Skip to content

Commit

Permalink
Fix blueprint error when publishing Eloquent Driver migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Sep 5, 2023
1 parent 0e031d1 commit 79ac147
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use DoubleThreeDigital\Runway\Search\Searchable;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Traits\Conditionable;
use Statamic\Facades\CP\Nav;
use Statamic\Facades\GraphQL;
Expand Down Expand Up @@ -74,7 +75,17 @@ public function boot()
], 'runway-config');

Statamic::booted(function () {
Runway::discoverResources();
// We're try/catching this to cover cases where blueprints aren't available yet
// (eg. migrating to the Eloquent driver but haven't yet published the migrations)
try {
Runway::discoverResources();
} catch (\Exception $e) {
if (! $this->app->runningInConsole()) {
throw $e;
}

Log::error($e->getMessage());
}

$this->registerPermissions();
$this->registerPolicies();
Expand Down

0 comments on commit 79ac147

Please sign in to comment.