zedisdog/laravel-schema-extend

supplement for eloquent migration
74,777 61
Install
composer require zedisdog/laravel-schema-extend
Latest Version:1.4.1
PHP:>=5.4.0
License:WTFPL
Last Updated:May 26, 2022
Links: GitHub  ·  Packagist
Maintainer: zedisdog

laravel-schema-extend

License

  • support MySQL 'table comment'.
  • 'column comment' is built-in in greater than 5.1 version.
  • support variable length for integer/tinyint/mediumint/smallint/bigint

just extend the original class

Install

Require this package with composer using the following command:

composer require zedisdog/laravel-schema-extend

less than 5.5

modify the alias Schema in config/app.php:

'aliases' => [
    ...
    // 'Schema' => Illuminate\Support\Facades\Schema::class,
    'Schema'    => Jialeo\LaravelSchemaExtend\Schema::class,
],

great than 5.5

just modify use statement from

use Illuminate\Support\Facades\Schema;

to

use Jialeo\LaravelSchemaExtend\Schema;

in migrate files.

Usage

Schema::create('tests', function ($table) {
    //this is alredy built-in.
    $table->increments('id')->comment('column comment');
    
    $table->integer('int')->default(1)->length(1);
    $table->bigInteger('big')->default(1)->length(1);
    $table->smallInteger('small')->default(1)->length(1);
    $table->tinyInteger('tiny')->default(1)->length(1);
    $table->mediumInteger('medium')->default(1)->length(1);
    
    $table->comment = 'table comment';
    $table->autoIncrement = 100;
});

Thanks

PS.

sorry for my bad english

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

404,034,618 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

387,976,821 4,658