diff options
-rw-r--r-- | database/migrations/create_scorm_tables.php.stub | 2 | ||||
-rw-r--r-- | src/Model/ScormModel.php | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/database/migrations/create_scorm_tables.php.stub b/database/migrations/create_scorm_tables.php.stub index cc9dc38..496aca4 100644 --- a/database/migrations/create_scorm_tables.php.stub +++ b/database/migrations/create_scorm_tables.php.stub @@ -22,7 +22,7 @@ class CreateScormTables extends Migration // scorm_model Schema::create($tableNames['scorm_table'], function (Blueprint $table) { $table->bigIncrements('id'); - $table->morphs('resource'); + $table->nullableMorphs('resource'); $table->string('title'); $table->string('origin_file')->nullable(); $table->string('version'); diff --git a/src/Model/ScormModel.php b/src/Model/ScormModel.php index d9ae680..35b2d4e 100644 --- a/src/Model/ScormModel.php +++ b/src/Model/ScormModel.php @@ -10,6 +10,25 @@ class ScormModel extends Model { /** + * The attributes that are mass assignable. + * + * @var array + */ + protected $fillable = [ + 'id', + 'resource_id', + 'resource_type', + 'title', + 'origin_file', + 'version', + 'ratio', + 'uuid', + 'entry_url', + 'created_at', + 'updated_at', + ]; + + /** * Get the parent resource model (user or post). */ public function resourceable() |