PHP 8.3.31
Preview: ContextServiceProvider.php Size: 1.09 KB
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Log/Context/ContextServiceProvider.php

<?php

namespace Illuminate\Log\Context;

use Illuminate\Queue\Events\JobProcessing;
use Illuminate\Queue\Queue;
use Illuminate\Support\Facades\Context;
use Illuminate\Support\ServiceProvider;

class ContextServiceProvider extends ServiceProvider
{
    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->scoped(Repository::class);
    }

    /**
     * Boot the application services.
     *
     * @return void
     */
    public function boot()
    {
        Queue::createPayloadUsing(function ($connection, $queue, $payload) {
            /** @phpstan-ignore staticMethod.notFound */
            $context = Context::dehydrate();

            return $context === null ? $payload : [
                ...$payload,
                'illuminate:log:context' => $context,
            ];
        });

        $this->app['events']->listen(function (JobProcessing $event) {
            /** @phpstan-ignore staticMethod.notFound */
            Context::hydrate($event->job->payload()['illuminate:log:context'] ?? null);
        });
    }
}

Directory Contents

Dirs: 1 × Files: 2

Name Size Perms Modified Actions
Events DIR
- drwxrwxrwx 2025-09-17 06:52:54
Edit Download
1.09 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
13.16 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).