[ 'source' => 'name' ] ]; } public function parent_category() { return $this->belongsTo(ParentCategory::class, 'parent', 'id'); } public function posts() { return $this->hasMany(Post::class, 'category', 'id'); } }