public function getAll($lang = "")
    {
        $result = [];
        $postType = PostType::all()->orderBy('postTypeID');
        foreach ($postType as $postType){
            $postType->categories = Category::where("postTypeID", $postType->postTypeID)->get();
            $result[] = $postType;
        }

        return ['data' => $result];
    }
public function getAll($lang = "")
    {
        $result = [];
        $postType = PostType::all()->orderBy('postTypeID');
        foreach ($postType as $postType){
            $postType->categories = Category::where("postTypeID", $postType->postTypeID)->get();
            $result[] = $postType;
        }

        return ['data' => $result];
    }
public function getAll ( $ lang = "" ) { $ result = [ ] ; $ postType = PostType :: all ( ) -> orderBy ( 'postTypeID' ) ; foreach ( $ postType as $ postType ) { $ postType -> categories = Category :: where ( "postTypeID" , $ postType -> postTypeID ) -> get ( ) ; $ result [ ] = $ postType ; } return [ 'data' => $ result ] ; }
Gets post type with his category.

@param  string $lang
@return array|\Illuminate\Contracts\Pagination\Paginator
@throws \Exception
Gets post type with his category .