jyim / laravel-schema-extend
Laravel 10.x 适配版:为迁移提供表注释 / 自增起始值 / 带长度的整型列(源自 zedisdog/laravel-schema-extend)
1.0.0
2026-11-05 08:51 UTC
Requires
- php: ^8.1
- illuminate/database: ^10.0
- illuminate/support: ^10.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-06 06:56:01 UTC
README
- 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 jyim/laravel-schema-extend
less than 5.5
modify the alias Schema in config/app.php:
'aliases' => [ ... // 'Schema' => Illuminate\Support\Facades\Schema::class, 'Schema' => Jyim\LaravelSchemaExtend\Schema::class, ],
great than 5.5
just modify use statement from
use Illuminate\Support\Facades\Schema;
to
use Jyim\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