$data = SELF::select('id','super_parent_id','name',status)
->with(['table_three'=>function($qry2) use ($bajetMain) {
$qry2->where('super_parent_id', 'pointer to super_parent_id');
};])->get()->toArray();
I try the code and expect it to point to its immediate previous parent. I done declaring all the relation. it says column not found. i checked yes the column exhist.