Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

True Laravel 11 support #71

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion config/database-schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,16 @@
'queue:*',
'schedule:*',
'view:*',
'phpunit:*'
'phpunit:*',
'install:*',
'channel:*',
'about',
'docs',
'model:*',
'storage:unlink',
'lang:publish',
'_complete',
'completion',
]
],

Expand Down
7 changes: 5 additions & 2 deletions src/DatabaseSchedulingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use RobersonFaria\DatabaseSchedule\Console\Commands\TestJobCommand;
use RobersonFaria\DatabaseSchedule\Console\Commands\ScheduleClearCacheCommand;
use RobersonFaria\DatabaseSchedule\Console\Scheduling\Schedule;
use Illuminate\Support\Facades\Schema;

class DatabaseSchedulingServiceProvider extends DatabaseScheduleApplicationServiceProvider
{
Expand Down Expand Up @@ -63,8 +64,10 @@ public function boot()
}

$this->app->resolving(BaseSchedule::class, function ($schedule) {
$schedule = app(Schedule::class, ['schedule' => $schedule]);
return $schedule->execute();
if (Schema::hasTable('schedules')) {
$schedule = app(Schedule::class, ['schedule' => $schedule]);
return $schedule->execute();
}
});

$this->commands([
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Services/CommandService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace RobersonFaria\DatabaseSchedule\Http\Services;

use App\Console\Kernel;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Collection;

class CommandService
{
public function get(): Collection
{
$commands = collect(app(Kernel::class)->all())->sortKeys();
$commands = collect(Artisan::all())->sortKeys();
$commandsKeys = $commands->keys()->toArray();
foreach (config('database-schedule.commands.exclude') as $exclude) {
$commandsKeys = preg_grep("/^$exclude/", $commandsKeys, PREG_GREP_INVERT);
Expand Down
Loading