add hasMany
This commit is contained in:
@@ -15,4 +15,10 @@ class Document extends Model
|
|||||||
'name',
|
'name',
|
||||||
'parent_id',
|
'parent_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function childs() {
|
||||||
|
|
||||||
|
return $this->hasMany('App\Category','parent_id','id') ;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user