laravel / telescope

An elegant debug assistant for the Laravel framework.
https://laravel.com/docs/telescope
MIT License
4.84k stars 577 forks source link

[5.x] Suggestion : Modify `storage` variable in default config file #1444

Closed mho22 closed 6 months ago

mho22 commented 6 months ago

During the Laravel 11 update, I encountered a minor issue. Since I have a dedicated database for data from Pulse or Telescope, I needed to redirect connections to this database when loading the Pulse and Telescope dashboards.

For Pulse, it's straightforward to implement this using an environment variable called 'PULSE_DB_CONNECTION.' However, Telescope has a similar configuration with the environment variable 'DB_CONNECTION,' which is the database.default connection env variable.

A workaround could be to rewrite this in a dedicated config file, of course. However, I still thought it would be beneficial to suggest this pull request due to the current behavior of Pulse.

Pulse's default config file storage value :

'storage' => [
    'driver' => env('PULSE_STORAGE_DRIVER', 'database'),

    'database' => [
        'connection' => env('PULSE_DB_CONNECTION', null),
        'chunk' => 1000,
    ],
],

Telescope's default config file driver and storage values :

'driver' => env('TELESCOPE_DRIVER', 'database'),

'storage' => [
    'database' => [
        'connection' => env('DB_CONNECTION', 'mysql'),
        'chunk' => 1000,
    ],
],

P.S.: The description has been copied and pasted from the Pulse description and used for Telescope.

driesvints commented 6 months ago

This is a major breaking change for people who have published the telescope config file.

mho22 commented 6 months ago

You're right.