1
0
Fork 0
mirror of https://github.com/archtechx/tenancy-queue-tester.git synced 2025-12-12 15:34:05 +00:00
tenancy-queue-tester/setup/AppServiceProvider.php

28 lines
616 B
PHP
Executable file

<?php
namespace App\Providers;
use Illuminate\Queue\Events\JobProcessed;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Event::listen(JobProcessed::class, function () {
file_put_contents(base_path('jobprocessed_context'), tenant() ? ('tenant_' . tenant('id')) : 'central');
});
}
}