lasthourcloud/app/Providers/AppServiceProvider.php

36 lines
1015 B
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;
2023-05-03 08:06:15 +00:00
use Illuminate\Support\Str;
2023-03-17 14:33:48 +00:00
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
2023-05-09 12:46:22 +00:00
// if (config('app.env') === 'production' && Str::contains(config('version'), ['nightly'])) {
2023-05-03 08:24:13 +00:00
// Process::run('php artisan migrate:fresh --force --seed --seeder=ProductionSeeder');
// }
2023-03-17 14:33:48 +00:00
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Queue::after(function (JobProcessed $event) {
2023-05-03 08:06:15 +00:00
// @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
}
}