Skip to content

Commit

Permalink
Merge pull request #9 from a21ns1g4ts/patch-3
Browse files Browse the repository at this point in the history
Prevent table not found exception
  • Loading branch information
husam-tariq authored Aug 26, 2023
2 parents 8880066 + 9caa178 commit cf942ba
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/FilamentDatabaseScheduleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ public function boot()
$model = $config->get('filament-database-schedule.model');
$model::observe(ScheduleObserver::class);

if (Schema::hasTable($config->get('filament-database-schedule.table.schedules', 'schedules'))) {
$this->app->resolving(BaseSchedule::class, function ($schedule) {
$schedule = app(Schedule::class, ['schedule' => $schedule]);
return $schedule->execute();
});
}
try {
if (Schema::hasTable($config->get('filament-database-schedule.table.schedules', 'schedules'))) {
$this->app->resolving(BaseSchedule::class, function ($schedule) {
$schedule = app(Schedule::class, ['schedule' => $schedule]);
return $schedule->execute();
});
}
} catch (\Exception $e) {}

$this->commands([
TestJobCommand::class,
Expand Down

0 comments on commit cf942ba

Please sign in to comment.