RickDBCN / filament-email

Log emails in your Filament project
https://filament-email-demo.marcogermani.it/
MIT License
77 stars 23 forks source link

[Feat] Need to specify connection name for db. #74

Open Saifallak opened 1 month ago

Saifallak commented 1 month ago

In case of project with multi database connection, we need the ability to specify the database connection.

also we usually, create separate db, for activity logs and other monitoring,

and other packages doing that, like spatie activity logs, and telescope for laravel and pulse ...etc.

steps: need to add

'database_connection' => env('ACTIVITY_LOGGER_DB_CONNECTION', 'mysql'),

to config

also

in schemas

Schema::connection(config('xxxxxx.database_connection'))->create('xxxxxx', function (Blueprint $table) {

also in model construct

if (! isset($this->connection)) {
            $this->setConnection(config('xxxxxxx.database_connection'));
        }

example https://github.com/spatie/laravel-activitylog/pull/568/files