diff --git a/config/filament-comments.php b/config/filament-comments.php index 286b622..314f3a8 100644 --- a/config/filament-comments.php +++ b/config/filament-comments.php @@ -71,4 +71,10 @@ * The name of the table where the comments are stored. */ 'table_name' => 'filament_comments', + + /* + * If the name of your database connection is not the default, you may provide it here. + * In the published migration, add the connection to table creation with: `Schema::connection('your_connection_name')->create(...)` as usual. + */ + // 'connection_name' => '', ]; diff --git a/src/Models/FilamentComment.php b/src/Models/FilamentComment.php index a75b7bf..acb696e 100644 --- a/src/Models/FilamentComment.php +++ b/src/Models/FilamentComment.php @@ -29,6 +29,10 @@ public function __construct(array $attributes = []) $this->setTable($config['table_name']); } + if(!empty($config['connection_name'])) { + $this->setConnection($config['connection_name']); + } + parent::__construct($attributes); }