ouiflash/laravel-migration

improving the migration files

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

The purpose of this small package is to improve the laravel migration files.

Install

Via Composer

$ composer require ouiflash/laravel-migration

Usage

<?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];
    }
}

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email remi.fussien@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.