lundi 13 avril 2020

Update Enum Options using Laravel Migration

If the enums are modified in the enums.php file, how would I change the migration?

I have my migration file like the following-

    public function up()
    {
        Schema::create('increase_pond_height', function (Blueprint $table) {
            $table->increments('id');
            $table->float('height', 8, 2);
            $table->enum('purpose', Config::get('enums.increase_pond_height_purposes'));
            $table->string('comments', 500)->nullable();
            $table->timestamps();
        });
    }

I have the enum.php in Config like the following-

<?php

return [
    'increase_pond_height_purposes' => ['innoculum', 'harvest', 'media_addition']
];


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire