adrema/app/Initialize/InitializeJob.php

34 lines
643 B
PHP
Raw Normal View History

2020-04-12 00:26:44 +02:00
<?php
namespace App\Initialize;
2022-09-02 00:45:39 +02:00
use Exception;
2021-11-17 22:32:52 +01:00
use Illuminate\Bus\Queueable;
2020-04-12 00:26:44 +02:00
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
2021-11-17 22:32:52 +01:00
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
2020-04-12 00:26:44 +02:00
class InitializeJob implements ShouldQueue
{
2022-03-11 20:19:17 +01:00
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
2020-04-12 00:26:44 +02:00
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
2022-02-19 18:06:07 +01:00
app(Initializer::class)->run();
2020-04-12 00:26:44 +02:00
}
2022-09-02 00:45:39 +02:00
public function failed(Exception $e): void
{
app(Initializer::class)->restore();
}
2020-04-12 00:26:44 +02:00
}