lasthourcloud/app/Providers/AppServiceProvider.php

41 lines
1.1 KiB
PHP
Raw Normal View History

2023-03-17 14:33:48 +00:00
<?php
namespace App\Providers;
2023-05-03 06:24:34 +00:00
use App\Jobs\CoolifyTask;
2023-03-30 07:47:04 +00:00
use Illuminate\Queue\Events\JobProcessed;
2023-04-14 08:00:42 +00:00
use Illuminate\Support\Facades\Process;
2023-03-30 07:47:04 +00:00
use Illuminate\Support\Facades\Queue;
2023-03-17 14:33:48 +00:00
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
2023-04-14 08:00:42 +00:00
// @TODO: Is this the best place to run the seeder?
// if (env('APP_ENV') === 'production') {
// dump('Seed default data.');
// Process::run('php artisan db:seed --class=ProductionSeeder --force');
// } else {
// dump('Not in production environment.');
// }
2023-03-17 14:33:48 +00:00
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Queue::after(function (JobProcessed $event) {
// @TODO: Remove `coolify-builder` container after the remoteProcess job is finishged and remoteProcess->type == `deployment`.
2023-05-03 06:24:34 +00:00
if ($event->job->resolveName() === CoolifyTask::class) {
}
});
2023-03-17 14:33:48 +00:00
}
}