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

alierdem's avatar

Can't see background jobs on Telescope if i trigger them from a Filamentphp action

hello people i am trying to solve this weird problem i am having. i have this endpoint, if i visit this endpoint a job is triggered and i can see that job in telescope.

Route::get('info', function (){
   \App\Jobs\ImportCatalogJob::dispatch(\App\Models\Catalog::first(), null);
});

but if i dispatch same job from a filament table action like this :

 ->actions([
                Tables\Actions\EditAction::make()->button()->size('xs'),
                Action::make('re_ingest')
                    ->label('Import now')
                    ->icon('heroicon-s-eye')
                    ->button()
                    ->color('info')
                    ->size('xs')
                    ->action(function (Catalog $record) {
                        ImportCatalogJob::dispatch($record, null);
                        Notification::make()
                            ->title('Import started')
                            ->success()
                            ->send();

                    }),
            ])

i can see the job is running (from the output of php artisan queue:work command i am running), and job runs successfully, it does what it needs to do. but i cannot see the job in the Telescope dashboard. even when i throw an error in the job i cant see it in telescope.

0 likes
3 replies
LaryAI's avatar
Level 58

It sounds like the issue might be related to the context in which the job is being dispatched. When you dispatch the job from a Filament action, it might be running in a different context or with different configurations that affect how Telescope captures the job.

Here are a few steps to troubleshoot and potentially resolve the issue:

  1. Ensure Telescope is Enabled: Make sure that Telescope is enabled in the environment where you are running the Filament action. Sometimes Telescope might be disabled in certain environments (e.g., production).

    // config/telescope.php
    'enabled' => env('TELESCOPE_ENABLED', true),
    
  2. Check Telescope's Configuration: Verify that the job watcher is enabled in your Telescope configuration.

    // config/telescope.php
    'watchers' => [
        // Other watchers...
        \Laravel\Telescope\Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true),
    ],
    
  3. Ensure Proper Context: Ensure that the job is being dispatched within the proper context. Sometimes, the context in which the job is dispatched can affect how Telescope captures it. You can try explicitly setting the context within the action.

    use Laravel\Telescope\Telescope;
    
    Action::make('re_ingest')
        ->label('Import now')
        ->icon('heroicon-s-eye')
        ->button()
        ->color('info')
        ->size('xs')
        ->action(function (Catalog $record) {
            Telescope::withoutRecording(function () use ($record) {
                ImportCatalogJob::dispatch($record, null);
            });
    
            Notification::make()
                ->title('Import started')
                ->success()
                ->send();
        }),
    
  4. Check for Telescope Middleware: Ensure that the request is passing through the middleware that enables Telescope. Sometimes, custom routes or actions might bypass the middleware stack.

    // Ensure the middleware is applied in your routes/web.php or routes/api.php
    Route::middleware(['web', 'telescope'])->group(function () {
        Route::get('info', function () {
            \App\Jobs\ImportCatalogJob::dispatch(\App\Models\Catalog::first(), null);
        });
    });
    
  5. Check for Telescope's Storage: Ensure that Telescope is storing the entries correctly. Sometimes, Telescope might not be able to store entries due to configuration issues.

    // Ensure your .env file has the correct storage driver
    TELESCOPE_DRIVER=database
    
  6. Clear Telescope Entries: Sometimes, clearing Telescope's entries can help resolve issues with displaying new entries.

    php artisan telescope:clear
    

By following these steps, you should be able to identify and resolve the issue with Telescope not displaying the jobs dispatched from a Filament action. If the problem persists, consider checking the logs for any errors related to Telescope and ensure that all necessary configurations are correctly set.

alierdem's avatar
alierdem
OP
Best Answer
Level 2

damn i solved it, it was my stupidity. filament runs on livewire and by default telescope config has "livewire*" in ignored paths.

3 likes

Please or to participate in this conversation.