承接 laralabs/connection-loader 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laralabs/connection-loader

Composer 安装命令:

composer require laralabs/connection-loader

包简介

Load database connections into config from database table

README 文档

README

Have you ever wanted to add database connections from the backend of a Laravel application without the need to edit the configuration files?

Connection Loader for Laravel is a ServiceProvider that loads database connection details from a table in the specified database connection.

You can then access these connections using their name property's with conventional Laravel techniques.

Installation

Install via composer by adding the following line to your composer.json file:

"laralabs/connection-loader": "~1.0.0"

After updating composer you will need to add the ServiceProvider to the providers array in config/app.php

Laralabs\ConnectionLoader\ConnectionLoaderServiceProvider::class,

Once you have added this line to your applications configuration file run the following command the publish the config file to config/connectionloader.php and migration file to database/migrations/2016_05_02_000000_create_connection_loader_table.php:

php artisan vendor:publish

You should receive confirmation that the files have been copied over from artisan.

Now the database table needs to be created, run the database migration with (this will run using the default connection and with a table name of connection_loader):

php artisan migrate

Once the database table has been created the configuration file located at config/connectionloader.php needs to be altered, here are it's default values:

<?php

return array(
    'enabled'       =>  false,
    'connection'    =>  'mysql',
    'table'         =>  'connection_loader',
    'check_enabled' =>  false,
);

Set the value of connection to your default connection, default Laravel value provided.

If you altered the connection or database table in the migration before running php artisan migrate then you will need to update the configuration file to reflect the changes before enabling Connection Loader.

Set the value of enabled from false to true to enable the ServiceProvider.

check_enabled is a feature which will check the connections for connectivity, it will update the status field in the connections table with a boolean value. Please note this could become resource intensive and increase page load times if you have a high amount of connections, it is disabled by default.

Support

Please raise an issue on Github if there is a problem.

License

This is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固