protected function getFromCasts(Model $model, $key)
    {
        $casts = $this->getCasts($model);

        if (!isset($casts[$key])) {
            return '';
        }

        $cast = $casts[$key];

        foreach ($this->xTypeToCasts as $xType=>$casts) {
            if (in_array($cast, $casts)) {
                return $xType;
            }
        }

        return 'string';
    }
protected function getFromCasts(Model $model, $key)
    {
        $casts = $this->getCasts($model);

        if (!isset($casts[$key])) {
            return '';
        }

        $cast = $casts[$key];

        foreach ($this->xTypeToCasts as $xType=>$casts) {
            if (in_array($cast, $casts)) {
                return $xType;
            }
        }

        return 'string';
    }
protected function getFromCasts ( Model $ model , $ key ) { $ casts = $ this -> getCasts ( $ model ) ; if ( ! isset ( $ casts [ $ key ] ) ) { return '' ; } $ cast = $ casts [ $ key ] ; foreach ( $ this -> xTypeToCasts as $ xType => $ casts ) { if ( in_array ( $ cast , $ casts ) ) { return $ xType ; } } return 'string' ; }
Get the typename from the casts array

@param Model  $model
@param string $key

@return string The type name
Get the typename from the casts array