protected function toModelAttributes($model, $attributes)
    {
        $filtered = [];
        $filter = $this->getAttributeFilter();

        foreach ($attributes as $key => $value) {
            if (!$filter($key, $value)) {
                continue;
            }

            $filtered[$key] = $value;
        }

        return $filtered;
    }
protected function toModelAttributes($model, $attributes)
    {
        $filtered = [];
        $filter = $this->getAttributeFilter();

        foreach ($attributes as $key => $value) {
            if (!$filter($key, $value)) {
                continue;
            }

            $filtered[$key] = $value;
        }

        return $filtered;
    }
protected function toModelAttributes ( $ model , $ attributes ) { $ filtered = [ ] ; $ filter = $ this -> getAttributeFilter ( ) ; foreach ( $ attributes as $ key => $ value ) { if ( ! $ filter ( $ key , $ value ) ) { continue ; } $ filtered [ $ key ] = $ value ; } return $ filtered ; }
Cast an clean the incoming attributes so that this repository can
savely pass them to the database.
The attributes have to be validated before passing them to this method.

@param mixed $model
@param array $attributes

@return array
Cast an clean the incoming attributes so that this repository can savely pass them to the database . The attributes have to be validated before passing them to this method .