Skip to content

Commit e51bd85

Browse files
authored
Fixes for laravel 11
1 parent e2d847e commit e51bd85

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

config/database-schedule.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,16 @@
9090
'queue:*',
9191
'schedule:*',
9292
'view:*',
93-
'phpunit:*'
93+
'phpunit:*',
94+
'install:*',
95+
'channel:*',
96+
'about',
97+
'docs',
98+
'model:*',
99+
'storage:unlink',
100+
'lang:publish',
101+
'_complete',
102+
'completion',
94103
]
95104
],
96105

src/DatabaseSchedulingServiceProvider.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use RobersonFaria\DatabaseSchedule\Console\Commands\TestJobCommand;
1414
use RobersonFaria\DatabaseSchedule\Console\Commands\ScheduleClearCacheCommand;
1515
use RobersonFaria\DatabaseSchedule\Console\Scheduling\Schedule;
16+
use Illuminate\Support\Facades\Schema;
1617

1718
class DatabaseSchedulingServiceProvider extends DatabaseScheduleApplicationServiceProvider
1819
{
@@ -63,8 +64,10 @@ public function boot()
6364
}
6465

6566
$this->app->resolving(BaseSchedule::class, function ($schedule) {
66-
$schedule = app(Schedule::class, ['schedule' => $schedule]);
67-
return $schedule->execute();
67+
if (Schema::hasTable('schedules')) {
68+
$schedule = app(Schedule::class, ['schedule' => $schedule]);
69+
return $schedule->execute();
70+
}
6871
});
6972

7073
$this->commands([

src/Http/Services/CommandService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class CommandService
99
{
1010
public function get(): Collection
1111
{
12-
$commands = collect(app( Artisan::class)->all())->sortKeys();
12+
$commands = collect(Artisan::all())->sortKeys();
1313
$commandsKeys = $commands->keys()->toArray();
1414
foreach (config('database-schedule.commands.exclude') as $exclude) {
1515
$commandsKeys = preg_grep("/^$exclude/", $commandsKeys, PREG_GREP_INVERT);

0 commit comments

Comments
 (0)