ouiflash/laravel-migration

改进迁移文件

此包的官方仓库似乎已不存在,因此包已被冻结。

1.2.0 2019-09-18 13:51 UTC

This package is auto-updated.

Last update: 2021-05-18 17:30:46 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

此小包的目的是改进 Laravel 迁移文件。

安装

通过 Composer

$ composer require ouiflash/laravel-migration

使用方法

<?php

use Ouiflash\LaravelMigration\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateLegalStatusesTable extends Migration
{
    public function definitions()
    {
        return [
            'legal_statuses' => function (Blueprint $table) {
                $table
                    ->uuid('id')
                    ->primary();

                $table
                    ->string('country_code')
                    ->comment = 'ISO 3166-1 alpha-2 (e.g. FR, GB, DE, ...)';

                $table
                    ->string('name')
                    ->comment = 'Name of the legal status';

                $table
                    ->string('description')
                    ->nullable()
                    ->comment = 'Description of the legal status';

                $table->timestamps();
            },
        ];
    }

    /**
     * Some data might be seeded during the migration
     */
    public function seed()
    {
        return [new LegalStatusTableSeeder];
    }
}

测试

$ composer test

贡献

请参阅 CONTRIBUTINGCODE_OF_CONDUCT 以获取详细信息。

安全

如果您发现任何安全相关的问题,请发送电子邮件至 remi.fussien@gmail.com 而不是使用问题跟踪器。

鸣谢

许可

MIT 许可证 (MIT)。请参阅 许可文件 以获取更多信息。