add hasMany

This commit is contained in:
Александр Бабкин
2022-07-03 16:46:35 +03:00
parent 6bafca0eb6
commit 62482b624d

View File

@@ -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') ;
}
} }