Browse Source

json字段改成text

jqh 4 years ago
parent
commit
15ae5c8e31

+ 1 - 1
database/migrations/2020_09_22_015815_create_admin_extensions_table.php

@@ -18,7 +18,7 @@ class CreateAdminExtensionsTable extends Migration
             $table->string('name', 100)->unique();
             $table->string('version', 20)->default('');
             $table->tinyInteger('is_enabled')->default(0);
-            $table->json('options')->nullable();
+            $table->text('options')->nullable();
             $table->timestamps();
 
             $table->engine = 'InnoDB';

+ 4 - 0
src/Models/Extension.php

@@ -10,6 +10,10 @@ class Extension extends Model
 
     protected $fillable = ['name', 'is_enabled', 'version', 'options'];
 
+    protected $casts = [
+        'options' => 'json',
+    ];
+
     public function __construct(array $attributes = [])
     {
         $connection = config('admin.database.connection') ?: config('database.default');