作者 赵彬吉

Merge branch 'develop' into zbj

... ... @@ -13,3 +13,4 @@ npm-debug.log
yarn-error.log
/.idea
/.vscode
composer.lock
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: zhl
* Date: 2023/4/12
* Time: 15:33
*/
namespace App\Console\Commands;
use App\Models\Project;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
/**
* Class ProjectInitDatabase
* @package App\Console\Commands
*/
class ProjectInit extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'project:init';
/**
* The console command description.
*
* @var string
*/
protected $description = '项目数据库初始化';
protected $connect = null;
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* @return bool
*/
public function handle()
{
#TODO 通过项目ID获取项目部署数据库配置, 创建数据库, 同步数据表
$project_id = 102;
$project = Project::getProjectById($project_id);
if (empty($project) || empty($project->mysqlConfig()))
return true;
$this->initDatabase($project);
return true;
}
/**
* @param Project $project
* @return bool
*/
public function initDatabase($project)
{
$create_flag = $this->createDatabase($project);
if (!$create_flag) {
// 创建数据库失败 添加通知以及再次处理
}
// 设置 database.connections.custom_mysql 数据
config(['database.connections.custom_mysql.host' => $project->mysqlConfig()->host]);
config(['database.connections.custom_mysql.port' => $project->mysqlConfig()->port]);
config(['database.connections.custom_mysql.database' => $project->databaseName()]);
config(['database.connections.custom_mysql.username' => $project->mysqlConfig()->user]);
config(['database.connections.custom_mysql.password' => $project->mysqlConfig()->password]);
// TODO 创建对应库 初始化数据表
$this->initTable();
return true;
}
/**
* @return bool
*/
public function initTable()
{
// $table = DB::select('show tables');
// $table = array_column($table, 'Tables_in_globalso_dev');
// $table = DB::connection('custom_tmp_mysql')->select('show tables');
// $table_in = DB::connection('custom_tmp_mysql')->getDatabaseName();
// dd($table, $table_in);
$database_name = DB::connection('custom_tmp_mysql')->getDatabaseName();
$table = Schema::connection('custom_tmp_mysql')->getAllTables();
$table = array_column($table, 'Tables_in_' . $database_name);
foreach ($table as $v) {
$has_table = Schema::connection('custom_mysql')->hasTable($v);
if ($has_table)
continue;
$connection = DB::connection('custom_tmp_mysql');
$sql = $connection->getDoctrineSchemaManager()
->getDatabasePlatform()
->getCreateTableSQL($connection->getDoctrineSchemaManager()->listTableDetails($v));
DB::connection('custom_mysql')->select($sql[0]);
}
return true;
}
/**
* 创建数据库
* 链接mysql 查询数据库是否存在 创建数据库
* @param Project $project
* @return bool|\mysqli_result|null
*/
public function createDatabase($project)
{
# 该方法需要:composer require parity-bit/laravel-db-commands
// $result = Artisan::call('db:create', [
// '--database' => $database_name,
// ]);
//
// return $result;
if ($this->connect)
return $this->connect;
//连接到 MySQL 服务器
$servername = $project->mysqlConfig()->host;
$username = $project->mysqlConfig()->user;
$password = $project->mysqlConfig()->password;
$conn = new \mysqli($servername, $username, $password);
//检查连接是否成功
if ($conn->connect_error) {
die("连接失败: " . $conn->connect_error);
}
$this->connect = $conn;
// $result = $conn->query('SHOW DATABASES LIKE \'' . $database_name . '\';');
// if ($result)
// return true;
$result = $conn->query('CREATE DATABASE ' . $project->databaseName() . ';');
return $result;
}
}
... ...
<?php
/**
* Created by PhpStorm.
* User: zhl
* Date: 2023/2/7
* Time: 17:58
*/
namespace App\Console\Commands\Test;
use GuzzleHttp\Client;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class Demo extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'demo';
/**
* The console command description.
*
* @var string
*/
protected $description = 'demo';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* @return bool
*/
public function handle()
{
$sql = 'CREATE DATABASE database_name;';
$results = DB::select($sql);
dd($results);
return true;
}
public function printMessage()
{
$client = new Client();
$headers = [
'Accept-Language' => 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control' => 'no-cache',
'Content-Type' => 'application/json',
'DNT' => '1',
'Origin' => 'http://openai.waimaoq.com',
'Pragma' => 'no-cache',
'Proxy-Connection' => 'keep-alive',
'Referer' => 'http://openai.waimaoq.com/docs',
'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36',
'accept' => 'application/json',
'Access-Control-Allow-Origin' => '*'
];
$body = '{
"prompt": "Human: 我需要一篇100字的英文原创博客并包含标题,内容结合:“cnc machine”。AI:"
}';
$response = $client->post('http://openai.waimaoq.com/v1/openai_chat_stream', [
'stream' => true,
'headers' => $headers,
'body' => $body
]);
// 获取响应流对象
$stream = $response->getBody();
// 设置输出缓冲区
ob_start();
// 读取流中的数据并输出到页面
while (!$stream->eof()) {
echo $stream->read(4);
ob_flush();
flush();
}
dd(1);
}
}
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@ namespace App\Http\Middleware\Bside;
use App\Enums\Common\Code;
use App\Models\ProjectMenu;
use App\Models\ProjectRole as ProjectRoleModel;
use App\Services\ProjectServer;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
... ... @@ -29,6 +30,9 @@ class LoginAuthMiddleware
if(empty($info)){
return response(['code'=>Code::USER_ERROR,'msg'=>'当前用户未登录']);
}
// 设置数据信息
ProjectServer::useProject($info['project_id']);
//操作权限设置
$projectRoleModel = new ProjectRoleModel();
$role_info = $projectRoleModel->read(['id'=>$info['role_id']]);
... ...
... ... @@ -12,6 +12,8 @@ class Project extends Base
public $timestamps = true;
protected $dateFormat = 'Y-m-d';
const DATABASE_NAME_FIX = 'globalso_project_';
/**
* @name:获取当前对象不分页列表
*/
... ... @@ -19,4 +21,52 @@ class Project extends Base
$lists = DB::table($this->table)->select(['*'])->where($this->map)->orderBy($this->order)->get();
return $lists;
}
/**
* 通过ID获取项目信息
* @param $id
* @return self
*/
public static function getProjectById($id)
{
return self::where(['id' => $id])->first();
}
/**
* 项目部署服务器信息
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function serverConfig()
{
return self::hasOne(ServeConfig::class, 'id', 'serve_id');
}
/**
* 项目部署mysql数据库信息
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function mysqlConfig()
{
return self::hasOne(ServeConfig::class, 'id', 'mysql_id');
}
/**
* 项目使用Redis服务器信息, 如果没有即使用默认配置
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function redisConfig()
{
return self::hasOne(ServeConfig::class, 'id', 'redis_id');
}
/**
* 获取项目对应数据库名称
* 初始化数据库、数据表迭代等功能使用
* TODO 如果前缀变更,请使用该方法进行处理
* @return string
*/
public function databaseName()
{
return self::DATABASE_NAME_FIX . $this->id;
}
}
... ...
<?php
/**
* Created by PhpStorm.
* User: zhl
* Date: 2023/4/17
* Time: 10:04
*/
namespace App\Models;
/**
* 服务账户信息
* Class ServeConfig
* @package App\Models
*/
class ServeConfig extends Base
{
/**
* @var string
*/
protected $table = 'gl_server_config';
/**
* @var array
*/
protected $guarded = ['updated_at'];
/**
* 1:服务器, 2:MySQL, 3:Redis
*/
const TYPE_SERVER = 1;
const TYPE_MYSQL = 2;
const TYPE_REDIS = 3;
/**
* 用户名加密
* @param $value
*/
public function setUserAttribute($value)
{
$this->attributes['user'] = encrypt($value);
}
/**
* 密码加密
* @param $value
*/
public function setPasswordAttribute($value)
{
$this->attributes['password'] = encrypt($value);
}
/**
* 端口加密
* @param $value
*/
public function setPortAttribute($value)
{
$this->attributes['Port'] = encrypt($value);
}
/**
* @return mixed
*/
public function getUserAttribute()
{
return decrypt($this->user);
}
/**
* @return mixed
*/
public function getPasswordAttribute()
{
return decrypt($this->password);
}
/**
* @return mixed
*/
public function getPortAttribute()
{
return decrypt($this->port);
}
}
\ No newline at end of file
... ...
... ... @@ -42,16 +42,16 @@ class RouteServiceProvider extends ServiceProvider
$this->mapBsideRoute();
// 暂时无用
// $this->routes(function () {
// Route::prefix('api')
// ->middleware('api')
// ->namespace($this->namespace)
// ->group(base_path('routes/api.php'));
//
// Route::middleware('web')
// ->namespace($this->namespace)
// ->group(base_path('routes/web.php'));
// });
$this->routes(function () {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
});
}
/**
... ...
<?php
/**
* Created by PhpStorm.
* User: zhl
* Date: 2023/4/17
* Time: 15:16
*/
namespace App\Services;
use App\Models\Project;
/**
* Class ProjectServer
* @package App\Services
*/
class ProjectServer extends BaseService
{
/**
* @param $project_id
* @return bool
*/
public static function useProject($project_id)
{
$project = Project::getProjectById($project_id);
if (empty($project))
return false;
// 设置 database.connections.custom_mysql 配置
config(['database.connections.custom_mysql.host' => $project->mysqlConfig()->host]);
config(['database.connections.custom_mysql.port' => $project->mysqlConfig()->port]);
config(['database.connections.custom_mysql.database' => $project->databaseName()]);
config(['database.connections.custom_mysql.username' => $project->mysqlConfig()->user]);
config(['database.connections.custom_mysql.password' => $project->mysqlConfig()->password]);
// 设置 redis 配置
return true;
}
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@
"require": {
"php": "^7.3|^8.0",
"bensampo/laravel-enum": "^4.2",
"doctrine/dbal": "^3.6",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
... ...
... ... @@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ec0188ad5b235cba39d53baaa3d96767",
"content-hash": "6c3880102ef840b5bed38e672d350800",
"packages": [
{
"name": "asm89/stack-cors",
... ... @@ -305,6 +305,346 @@
"time": "2021-08-13T13:06:58+00:00"
},
{
"name": "doctrine/cache",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "1ca8f21980e770095a31456042471a57bc4c68fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb",
"reference": "1ca8f21980e770095a31456042471a57bc4c68fb",
"shasum": ""
},
"require": {
"php": "~7.1 || ^8.0"
},
"conflict": {
"doctrine/common": ">2.2,<2.4"
},
"require-dev": {
"cache/integration-tests": "dev-master",
"doctrine/coding-standard": "^9",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"symfony/cache": "^4.4 || ^5.4 || ^6",
"symfony/var-exporter": "^4.4 || ^5.4 || ^6"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.",
"homepage": "https://www.doctrine-project.org/projects/cache.html",
"keywords": [
"abstraction",
"apcu",
"cache",
"caching",
"couchdb",
"memcached",
"php",
"redis",
"xcache"
],
"support": {
"issues": "https://github.com/doctrine/cache/issues",
"source": "https://github.com/doctrine/cache/tree/2.2.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache",
"type": "tidelift"
}
],
"time": "2022-05-20T20:07:39+00:00"
},
{
"name": "doctrine/dbal",
"version": "3.6.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "57815c7bbcda3cd18871d253c1dd8cbe56f8526e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/57815c7bbcda3cd18871d253c1dd8cbe56f8526e",
"reference": "57815c7bbcda3cd18871d253c1dd8cbe56f8526e",
"shasum": ""
},
"require": {
"composer-runtime-api": "^2",
"doctrine/cache": "^1.11|^2.0",
"doctrine/deprecations": "^0.5.3|^1",
"doctrine/event-manager": "^1|^2",
"php": "^7.4 || ^8.0",
"psr/cache": "^1|^2|^3",
"psr/log": "^1|^2|^3"
},
"require-dev": {
"doctrine/coding-standard": "11.1.0",
"fig/log-test": "^1",
"jetbrains/phpstorm-stubs": "2022.3",
"phpstan/phpstan": "1.10.3",
"phpstan/phpstan-strict-rules": "^1.5",
"phpunit/phpunit": "9.6.4",
"psalm/plugin-phpunit": "0.18.4",
"squizlabs/php_codesniffer": "3.7.2",
"symfony/cache": "^5.4|^6.0",
"symfony/console": "^4.4|^5.4|^6.0",
"vimeo/psalm": "4.30.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"bin": [
"bin/doctrine-dbal"
],
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\DBAL\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.",
"homepage": "https://www.doctrine-project.org/projects/dbal.html",
"keywords": [
"abstraction",
"database",
"db2",
"dbal",
"mariadb",
"mssql",
"mysql",
"oci8",
"oracle",
"pdo",
"pgsql",
"postgresql",
"queryobject",
"sasql",
"sql",
"sqlite",
"sqlserver",
"sqlsrv"
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/3.6.1"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal",
"type": "tidelift"
}
],
"time": "2023-03-02T19:26:24+00:00"
},
{
"name": "doctrine/deprecations",
"version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de",
"reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de",
"shasum": ""
},
"require": {
"php": "^7.1|^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9",
"phpunit/phpunit": "^7.5|^8.5|^9.5",
"psr/log": "^1|^2|^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/v1.0.0"
},
"time": "2022-05-02T15:47:09+00:00"
},
{
"name": "doctrine/event-manager",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/event-manager.git",
"reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520",
"reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^0.5.3 || ^1",
"php": "^7.1 || ^8.0"
},
"conflict": {
"doctrine/common": "<2.9"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^10",
"phpstan/phpstan": "~1.4.10 || ^1.8.8",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"vimeo/psalm": "^4.24"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
},
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.",
"homepage": "https://www.doctrine-project.org/projects/event-manager.html",
"keywords": [
"event",
"event dispatcher",
"event manager",
"event system",
"events"
],
"support": {
"issues": "https://github.com/doctrine/event-manager/issues",
"source": "https://github.com/doctrine/event-manager/tree/1.2.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager",
"type": "tidelift"
}
],
"time": "2022-10-12T20:51:15+00:00"
},
{
"name": "doctrine/inflector",
"version": "2.0.4",
"source": {
... ... @@ -2597,6 +2937,55 @@
"time": "2023-02-25T19:38:58+00:00"
},
{
"name": "psr/cache",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/cache.git",
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Cache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for caching libraries",
"keywords": [
"cache",
"psr",
"psr-6"
],
"support": {
"source": "https://github.com/php-fig/cache/tree/master"
},
"time": "2016-08-06T20:24:11+00:00"
},
{
"name": "psr/container",
"version": "1.1.2",
"source": {
... ... @@ -8574,5 +8963,5 @@
"php": "^7.3|^8.0"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"
"plugin-api-version": "2.1.0"
}
... ...
... ... @@ -63,6 +63,46 @@ return [
]) : [],
],
'custom_tmp_mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE_TMP', 'globalso_project_tmp'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_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'),
]) : [],
],
'custom_mysql' => [
'driver' => 'mysql',
'url' => '', // DB_DATABASE_URL
'host' => '', // DB_DATABASE_HOST
'port' => '', // DB_DATABASE_PORT
'database' => '', // DB_DATABASE_CUSTOM
'username' => '', // DB_DATABASE_USER
'password' => '', // DB_DATABASE_PASSWORD
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_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'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
... ...