private function getPostSelectedCategories($id, $postTypeSlug)
    {
        // get the selected categories from the DB table categories_relations
        $categoryRelationTable = $postTypeSlug.'_categories';
        $selectedCategories = DB::table($categoryRelationTable)
            ->leftJoin('categories', $categoryRelationTable.'.categoryID', 'categories.categoryID')
            ->where($categoryRelationTable.'.postID', $id)
            ->select("categories.categoryID", "categories.postTypeID", "categories.title", "categories.slug")
            ->get();

        return Language::filterRows($selectedCategories, false);
    }
private function getPostSelectedCategories($id, $postTypeSlug)
    {
        // get the selected categories from the DB table categories_relations
        $categoryRelationTable = $postTypeSlug.'_categories';
        $selectedCategories = DB::table($categoryRelationTable)
            ->leftJoin('categories', $categoryRelationTable.'.categoryID', 'categories.categoryID')
            ->where($categoryRelationTable.'.postID', $id)
            ->select("categories.categoryID", "categories.postTypeID", "categories.title", "categories.slug")
            ->get();

        return Language::filterRows($selectedCategories, false);
    }
private function getPostSelectedCategories ( $ id , $ postTypeSlug ) { // get the selected categories from the DB table categories_relations $ categoryRelationTable = $ postTypeSlug . '_categories' ; $ selectedCategories = DB :: table ( $ categoryRelationTable ) -> leftJoin ( 'categories' , $ categoryRelationTable . '.categoryID' , 'categories.categoryID' ) -> where ( $ categoryRelationTable . '.postID' , $ id ) -> select ( "categories.categoryID" , "categories.postTypeID" , "categories.title" , "categories.slug" ) -> get ( ) ; return Language :: filterRows ( $ selectedCategories , false ) ; }
Get selected categories of a single post.

@param  int    $id
@param  string $postTypeSlug
@return array
Get selected categories of a single post .