From 0202821462c1bce99dceea0dea750cde48b151a5 Mon Sep 17 00:00:00 2001 From: Fred Bradley Date: Tue, 20 Jun 2023 16:05:42 +0100 Subject: [PATCH] test out new config for asset bank db --- app/Models/PublishAction.php | 1 + app/Models/SearchCriteria.php | 2 +- config/database.php | 20 +++++++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/Models/PublishAction.php b/app/Models/PublishAction.php index e8cbbb1..e283006 100644 --- a/app/Models/PublishAction.php +++ b/app/Models/PublishAction.php @@ -12,6 +12,7 @@ class PublishAction extends Model protected $fillable = ['ServerName']; + protected $connection = 'assetbank'; protected $primaryKey = 'Id'; public function searchCriteria() diff --git a/app/Models/SearchCriteria.php b/app/Models/SearchCriteria.php index 883a41f..f109f9e 100644 --- a/app/Models/SearchCriteria.php +++ b/app/Models/SearchCriteria.php @@ -7,7 +7,7 @@ class SearchCriteria extends Model { protected $table = 'searchcriteria'; - + protected $connection = 'assetbank'; public $timestamps = false; public $primaryKey = 'Id'; diff --git a/config/database.php b/config/database.php index c2e785b..25290f6 100644 --- a/config/database.php +++ b/config/database.php @@ -42,7 +42,25 @@ 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), ], - + 'assetbank' => [ + 'driver' => 'mysql', + //'url' => env('DATABASE_URL'), + 'host' => env('ASSET_BANK_DB_HOST', '127.0.0.1'), + 'port' => env('ASSET_BANK_DB_PORT', '3306'), + 'database' => env('ASSET_BANK_DB_DATABASE', 'assetbank'), + 'username' => env('ASSET_BANK_DB_USERNAME', 'forge'), + 'password' => env('ASSET_BANK_DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], 'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'),