public function getDataForCreate($lang, $postTypeSlug)
    {
        // Custom field groups
        $customFieldsGroups = CustomFieldGroup::findGroups('post-type', 'create', 0, $postTypeSlug);

        // post type
        $postType = PostType::where('slug', $postTypeSlug)->first();

        // Categories (options to select)
        $categories = array_values(Category::where("postTypeID", $postType->postTypeID)->get()->toArray());

        return [
            'postType' => $postType,
            'languages' => Language::all(),
            'categories' => $categories,
            'customFieldsGroups' => $customFieldsGroups,
            'postTypeFieldsValues' => $this->getPostTypeFieldsValues($postTypeSlug),
            'users' => User::all(),
            'createdByUserID' => Auth::user()->userID,
        ];
    }
public function getDataForCreate($lang, $postTypeSlug)
    {
        // Custom field groups
        $customFieldsGroups = CustomFieldGroup::findGroups('post-type', 'create', 0, $postTypeSlug);

        // post type
        $postType = PostType::where('slug', $postTypeSlug)->first();

        // Categories (options to select)
        $categories = array_values(Category::where("postTypeID", $postType->postTypeID)->get()->toArray());

        return [
            'postType' => $postType,
            'languages' => Language::all(),
            'categories' => $categories,
            'customFieldsGroups' => $customFieldsGroups,
            'postTypeFieldsValues' => $this->getPostTypeFieldsValues($postTypeSlug),
            'users' => User::all(),
            'createdByUserID' => Auth::user()->userID,
        ];
    }
public function getDataForCreate ( $ lang , $ postTypeSlug ) { // Custom field groups $ customFieldsGroups = CustomFieldGroup :: findGroups ( 'post-type' , 'create' , 0 , $ postTypeSlug ) ; // post type $ postType = PostType :: where ( 'slug' , $ postTypeSlug ) -> first ( ) ; // Categories (options to select) $ categories = array_values ( Category :: where ( "postTypeID" , $ postType -> postTypeID ) -> get ( ) -> toArray ( ) ) ; return [ 'postType' => $ postType , 'languages' => Language :: all ( ) , 'categories' => $ categories , 'customFieldsGroups' => $ customFieldsGroups , 'postTypeFieldsValues' => $ this -> getPostTypeFieldsValues ( $ postTypeSlug ) , 'users' => User :: all ( ) , 'createdByUserID' => Auth :: user ( ) -> userID , ] ; }
Get all data needed in the post create form.
Fields, Custom Fields, Categories, Languages.

@param  string $lang
@param  string $postTypeSlug
@return array
@throws \Exception
Get all data needed in the post create form . Fields Custom Fields Categories Languages .