protected function includeAvailableIncludes($model, $data )
    {

        // Get available includes from url parameters
        $includes = $this->getAvailableIncludesFromUrlParameters();

        // Create an return array
        $returnData = [];

        // Check if we have includes and include parameter values
        if ( ! empty( $includes ) && ! empty( $this->availableIncludes ) ) {

            // Loop through all includes
            foreach ($this->availableIncludes as $include) {

                // If the words exists in both includes
                if ( in_array( $include, $includes ) ) {

                    // Add the new data
                    $returnData[ $include ] = $this->includeByName( $include, $model );

                }
            }
        }

        // Return data
        return array_merge( $data, $returnData );
    }
protected function includeAvailableIncludes($model, $data )
    {

        // Get available includes from url parameters
        $includes = $this->getAvailableIncludesFromUrlParameters();

        // Create an return array
        $returnData = [];

        // Check if we have includes and include parameter values
        if ( ! empty( $includes ) && ! empty( $this->availableIncludes ) ) {

            // Loop through all includes
            foreach ($this->availableIncludes as $include) {

                // If the words exists in both includes
                if ( in_array( $include, $includes ) ) {

                    // Add the new data
                    $returnData[ $include ] = $this->includeByName( $include, $model );

                }
            }
        }

        // Return data
        return array_merge( $data, $returnData );
    }
protected function includeAvailableIncludes ( $ model , $ data ) { // Get available includes from url parameters $ includes = $ this -> getAvailableIncludesFromUrlParameters ( ) ; // Create an return array $ returnData = [ ] ; // Check if we have includes and include parameter values if ( ! empty ( $ includes ) && ! empty ( $ this -> availableIncludes ) ) { // Loop through all includes foreach ( $ this -> availableIncludes as $ include ) { // If the words exists in both includes if ( in_array ( $ include , $ includes ) ) { // Add the new data $ returnData [ $ include ] = $ this -> includeByName ( $ include , $ model ) ; } } } // Return data return array_merge ( $ data , $ returnData ) ; }
Include available includes

@return Array
Include available includes