From: Vincent Vanwaelscappel Date: Tue, 21 May 2019 16:25:45 +0000 (+0200) Subject: #2783 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=47723c039c67f118de7b6dd4393ef745271e5d41;p=cubist_cms-back.git #2783 --- diff --git a/src/app/Http/Controllers/CubistModelCrudController.php b/src/app/Http/Controllers/CubistModelCrudController.php index f4d3417..e711bb3 100644 --- a/src/app/Http/Controllers/CubistModelCrudController.php +++ b/src/app/Http/Controllers/CubistModelCrudController.php @@ -40,7 +40,7 @@ class CubistModelCrudController extends CrudController 'label' => 'Model table name', 'column' => true], 'create'); $this->addField(['type' => 'text', 'name' => 'label', 'label' => 'Model label', 'column' => true], 'both'); - $this->addField(['type' => 'textarea', 'name' => 'attributes', 'label' => 'Fields definitions'], 'both'); + $this->addField(['type' => 'textarea', 'name' => 'fields', 'label' => 'Fields definitions'], 'both'); // add asterisk for fields that are required in ModelRequest $this->crud->setRequiredFields(StoreRequest::class, 'create'); diff --git a/src/app/Models/CubistModel.php b/src/app/Models/CubistModel.php index 0a4ccb8..46354be 100644 --- a/src/app/Models/CubistModel.php +++ b/src/app/Models/CubistModel.php @@ -21,7 +21,7 @@ class CubistModel extends Model // protected $primaryKey = 'id'; // public $timestamps = false; // protected $guarded = ['id']; - protected $fillable = ['name', 'label', 'attributes']; + protected $fillable = ['name', 'label', 'fields']; // protected $hidden = []; // protected $dates = []; diff --git a/src/database/migrations/2019_05_20_161943_create_models_table.php b/src/database/migrations/2019_05_20_161943_create_models_table.php index c1d7a43..3ab4f2c 100644 --- a/src/database/migrations/2019_05_20_161943_create_models_table.php +++ b/src/database/migrations/2019_05_20_161943_create_models_table.php @@ -16,7 +16,7 @@ class CreateModelsTable extends Migration $table->increments('id'); $table->string('name')->unique(); $table->string('label'); - $table->json('attributes'); + $table->longText('fields'); $table->timestamps(); }); }