Various fixes for DB seeding
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Routing\Events\RouteMatched;
|
||||
use App\Models\Setting;
|
||||
use App\Listeners\ScheduleListener;
|
||||
@@ -22,9 +22,11 @@ public function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
$method = Setting::where('key', 'app.schedule_method')->value('value') ?? 'internal';
|
||||
if ($method === 'internal') {
|
||||
Event::listen(RouteMatched::class, [ScheduleListener::class, 'handle']);
|
||||
if (Schema::hasTable('settings')) {
|
||||
$method = Setting::where('key', 'app.schedule_method')->value('value') ?? 'internal';
|
||||
if ($method === 'internal') {
|
||||
Event::listen(RouteMatched::class, [ScheduleListener::class, 'handle']);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: read where to put these
|
||||
|
||||
Reference in New Issue
Block a user