src/RetrievesIntermediateTables.php
protected function intermediateAttributes(Model $model, $prefix)
    {
        $attributes = [];

        foreach ($model->getAttributes() as $key => $value) {
            if (strpos($key, $prefix) === 0) {
                $attributes[substr($key, strlen($prefix))] = $value;

                unset($model->$key);
            }
        }

        return $attributes;
    }
protected function intermediateAttributes(Model $model, $prefix)
    {
        $attributes = [];

        foreach ($model->getAttributes() as $key => $value) {
            if (strpos($key, $prefix) === 0) {
                $attributes[substr($key, strlen($prefix))] = $value;

                unset($model->$key);
            }
        }

        return $attributes;
    }
protected function intermediateAttributes ( Model $ model , $ prefix ) { $ attributes = [ ] ; foreach ( $ model -> getAttributes ( ) as $ key => $ value ) { if ( strpos ( $ key , $ prefix ) === 0 ) { $ attributes [ substr ( $ key , strlen ( $ prefix ) ) ] = $ value ; unset ( $ model -> $ key ) ; } } return $ attributes ; }
Get the intermediate attributes from a model.

@param  \Illuminate\Database\Eloquent\Model  $model
@param  string  $prefix
@return array
Get the intermediate attributes from a model .