Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Jeffsh's avatar
Level 6

Exclude the user to be watch from Laravel Pulse

I wanted to exclude the admin user from being recorded in Laravel Pulse. Specifically, if the admin user visits the pulse, their [email protected] should not be displayed as the top visitor.

This is not gonna work.

Recorders\UserJobs::class => [ 'enabled' => env('PULSE_USER_JOBS_ENABLED', true), 'sample_rate' => env('PULSE_USER_JOBS_SAMPLE_RATE', 1), 'ignore' => [ // '/^Package\\Jobs\\/', ], 'filter' => function ($user) { return $user->email !== '[email protected]'; }, ],

$ php artisan optimize:clear

0 likes
1 reply
LaryAI's avatar
Level 58

To exclude the admin user from being recorded in Laravel Pulse, you need to modify the configuration to filter out the admin user based on their email. The configuration you provided is almost correct, but it seems like there might be a syntax issue or a misunderstanding of how the filter function should be implemented.

Here's a corrected version of your configuration:

Recorders\UserJobs::class => [
    'enabled' => env('PULSE_USER_JOBS_ENABLED', true),
    'sample_rate' => env('PULSE_USER_JOBS_SAMPLE_RATE', 1),
    'ignore' => [
        // '/^Package\\Jobs\\/',
    ],
    'filter' => function ($user) {
        return $user->email !== '[email protected]';
    },
],

Make sure that the filter function is correctly implemented and that the email comparison is accurate. After updating the configuration, you should clear the cache and optimize the application again:

php artisan optimize:clear
php artisan config:cache

This should ensure that the admin user with the email [email protected] is excluded from being recorded in Laravel Pulse.

Please or to participate in this conversation.