fix bug column text is can't have default value
This commit is contained in:
@@ -106,4 +106,19 @@ class Menu extends Model
|
||||
get: fn () => $this->counter_handler ? new $this->counter_handler : null,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
static::bootTraits();
|
||||
|
||||
static::creating(function (Menu $menu) {
|
||||
if (empty($menu->actives)) {
|
||||
$menu->actives = [];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,9 @@ return new class extends Migration
|
||||
$table->unsignedTinyInteger('position');
|
||||
$table->boolean('enable')->default(true);
|
||||
$table->boolean('deleteable')->default(true);
|
||||
$table->longText('actives')->default('[]');
|
||||
$table->longText('actives')
|
||||
->nullable()
|
||||
->default(null);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('parent_id')
|
||||
|
||||
Reference in New Issue
Block a user