Skip to content

Commit f4b0cce

Browse files
committed
Added polymorphic function in scorm model. You can use polymorphic to call the scorm model in your project
1 parent bc15e45 commit f4b0cce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Model/ScormModel.php

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
class ScormModel extends Model
1010
{
1111

12+
/**
13+
* Get the parent resource model (user or post).
14+
*/
15+
public function resourceable()
16+
{
17+
return $this->morphTo(__FUNCTION__, 'resource_type', 'resource_id');
18+
}
19+
1220
public function getTable()
1321
{
1422
return config('scorm.table_names.scorm_table', parent::getTable());

0 commit comments

Comments
 (0)