]> _ Git - cubist_cms-back.git/commitdiff
wip #2628 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 13 Mar 2019 15:12:39 +0000 (16:12 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 13 Mar 2019 15:12:39 +0000 (16:12 +0100)
composer.json
src/app/Models/Field.php [new file with mode: 0644]
src/database/migrations/2019_03_13_180800_create_fields_table.php [new file with mode: 0644]

index ce10c2c7c0860504278361332095f86558c69c44..14f2905ed2a1114ecd49887304b29c86e505f15e 100644 (file)
@@ -31,7 +31,8 @@
         "cubist/util": "dev-master",
         "fideloper/proxy": "^4.0",
         "laravel/tinker": "^1.0",
-        "predis/predis": "^1.1"
+        "predis/predis": "^1.1",
+        "webfactor/laravel-backpack-instant-fields": "^2.1.2"
     },
     "require-dev": {
         "backpack/generators": "^1.2"
diff --git a/src/app/Models/Field.php b/src/app/Models/Field.php
new file mode 100644 (file)
index 0000000..747292a
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+
+namespace Cubist\Backpack\app\Models;
+
+use Backpack\CRUD\CrudTrait;
+use Illuminate\Database\Eloquent\Model;
+
+class Field extends Model
+{
+    use CrudTrait;
+
+    protected $table = 'cubist_fields';
+    protected $fillable = ['name', 'type','options'];
+}
diff --git a/src/database/migrations/2019_03_13_180800_create_fields_table.php b/src/database/migrations/2019_03_13_180800_create_fields_table.php
new file mode 100644 (file)
index 0000000..9fcc33c
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateFieldsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('cubist_fields', function (Blueprint $table) {
+            $table->increments('id');
+            $table->string('name');
+            $table->string('type');
+            $table->json('options');
+            $table->timestamps();
+        });
+
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::drop('cubist_fields');
+    }
+}