[ 'source' => 'name', 'onUpdate' => true ] ]; } public function parent(){ return $this->belongsTo(Category::class, 'category_id'); } public function children(){ return $this->hasMany(Category::class); } public function products() { return $this->hasMany(Product::class); } }