app/Models/MainCate.php
// MAIN CATEGORY RELATIONSHIP WITH SUB CATEGORIES
MAIN CATEGORY RELATIONSHIP WITH SUB CATEGORIES
MAIN CATEGORY RELATIONSHIP WITH SUB CATEGORIES
public function subCates()
    {
        return $this->hasMany(
            SubCate::class,
            'cate_id',
            'id'
        );
    }
public function subCates ( ) { return $ this -> hasMany ( SubCate :: class , 'cate_id' , 'id' ) ; }
MAIN CATEGORY RELATIONSHIP WITH SUB CATEGORIES
MAIN CATEGORY RELATIONSHIP WITH SUB CATEGORIES
// RETURN THE ONE OR MORE RELATED SUB CATEGORIES