shadetheartist/schema-info 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

shadetheartist/schema-info

Composer 安装命令:

composer require shadetheartist/schema-info

包简介

Analyze and navigate a databases' structure using a simple fluent api

README 文档

README

A utility class intended to help interface with a databases' schema information in an efficient manner.

Setting Up

Firstly add the schema-info dependency to your projects composer file

composer.json

"require": {
    ...,
    "shadetheartist/schema-info": "1.5.3"
}

In your terminal run composer dump-autoload.

Secondly add the SchemaInfo service provider and facade to your projects' bootstrapping procedure via

config/app.php

'providers' => [
    ...,
    SchemaInfo\SchemaInfoServiceProvider::class,
]

And you're set!

Examples

General Usage

Creating a New Schema Instance

<?php namespace App;

use SchemaInfo\Facades\SchemaInfo;

class Example
{
    public function example()
    {
        $schema = SchemaInfo::make();
    }
   
    public function exampleAltConnection()
    {
    	//connect to a different database. note: only mysql databases are currently supported.
        $schema = SchemaInfo::make(\DB::connection('my-alternative-connection'));
    }
}

Table Usage

$table = $schema->table('my_table_name');

//returns a stdClass instance refecting a record from the schema info of your database.
$info = $table->info();

Retrieving a Column

$table = $schema->table('my_table_name');

$column = $table->column('my_column_name');

$allColumns = $table->columns();

Column Usage

$column = $table->column('my_column_name');

//returns a stdClass instance refecting a record from the schema info of your database.
$column->info();

//get the table the column belongs to.
$parentTable = $column->table();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固