In Laravel,
hasMany() and belongsTo() creates Parent & Child Categories relationship.
Simply use in Model that extends Eloquent. For sample,
public function getChildValues() { return $this->hasMany('Category', 'parentid'); } public function getParentValues() { return $this->belongsTo('CategoryMN', 'id'); }
This link might help you.
And to retrieve for example, in Controller,
$categories_child = Category::with('getChildValues')->get();