Skip to content

Commit 54d511f

Browse files
committed
Added resource morphs nullable. This will give the flexibility for developer to embed to model or simply upload and store.
1 parent b415779 commit 54d511f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

database/migrations/create_scorm_tables.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CreateScormTables extends Migration
2222
// scorm_model
2323
Schema::create($tableNames['scorm_table'], function (Blueprint $table) {
2424
$table->bigIncrements('id');
25-
$table->morphs('resource');
25+
$table->nullableMorphs('resource');
2626
$table->string('title');
2727
$table->string('origin_file')->nullable();
2828
$table->string('version');

src/Model/ScormModel.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@
99
class ScormModel extends Model
1010
{
1111

12+
/**
13+
* The attributes that are mass assignable.
14+
*
15+
* @var array
16+
*/
17+
protected $fillable = [
18+
'id',
19+
'resource_id',
20+
'resource_type',
21+
'title',
22+
'origin_file',
23+
'version',
24+
'ratio',
25+
'uuid',
26+
'entry_url',
27+
'created_at',
28+
'updated_at',
29+
];
30+
1231
/**
1332
* Get the parent resource model (user or post).
1433
*/

0 commit comments

Comments
 (0)