From 1e114af25ece03f06de40bf972fdeec7ef886549 Mon Sep 17 00:00:00 2001 From: Jason Steelman Date: Tue, 1 Apr 2025 10:49:38 -0400 Subject: [PATCH 1/2] Update FilamentComment.php Implement connection name on comment model. --- src/Models/FilamentComment.php | 4 ++++ 1 file changed, 4 insertions(+) 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); } From dad07544f0a257c5d5d1f268d2830d39348e5a7e Mon Sep 17 00:00:00 2001 From: Jason Steelman Date: Tue, 1 Apr 2025 10:56:48 -0400 Subject: [PATCH 2/2] Update filament-comments.php Add connection option to publishable config w/ usage comment. --- config/filament-comments.php | 6 ++++++ 1 file changed, 6 insertions(+) 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' => '', ];