定制 fureszpeter/laratools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fureszpeter/laratools

Composer 安装命令:

composer require fureszpeter/laratools

包简介

Some usefull lib outside laravel, like Eloquent, Migartion, Config

README 文档

README

#laratools

If you are using phpmig, you need to create a phpmig.php into your project root folder or PROJECT_ROOT/config folder

##phpmig

This package depends on phpmig, so you can find the CLI command in vendor/bin/phpmig or vendor/davedevelopment/phpmig/bin/phpmig

Example:

use Phpmig\ConfigDTO;

$configAsterisk = new ConfigDTO("mysql", "127.0.0.1", "dbname", "username", "password");

$container = new Phpmig\Container(__DIR__ . "/../migrations");
$container->setDatabaseConnection("db", $configAsterisk);
$container->setEloquentCapsule("capsule", $configAsterisk);

$container->setAdapter($container["db"]);

return $container;

and in the migartions file

class InitSchema extends Migration
{
    const DB_KEY_NAME = "capsule";

    /* @var \Illuminate\Database\Schema\Builder $schema */
    protected $schema;

    public function init()
    {
        $this->schema = $this->get(self::DB_KEY_NAME)->schema();
    }

    /**
     * Do the migration
     */
    public function up()
    {
            $this->schema->create("states", function ($table) {
            /* @var Blueprint $table */
            $table->increments("id");
            $table->char("code", 2);
            $table->string("name", 64);
        });
    }
}

##Config

You can define your environment in a .env file in PROJECT_ROOT

Example .env file:

ENVIRONMENT=local

If environment is defined and we use during the object creation

Config file format

return [
    "driver" => "mysql"
];

Read config files, without the .env file

$config = new Config\Config(new \Symfony\Component\Finder\Finder(), __DIR__ . "/../config/development/");
echo $config->get("test.driver");

Read config files, with the .env file

$config = new Config\Config(new \Symfony\Component\Finder\Finder(), __DIR__ . "/../");
echo $config->get("test.driver");

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固