public static function utf8EncodeModel(Model $model)
    {
        foreach($model->toArray() as $key => $value) {
            if (is_numeric($value) || !is_string($value)) {
                continue;
            }
            $model->$key = utf8_encode($value);
        }

        return $model;
    }
public static function utf8EncodeModel(Model $model)
    {
        foreach($model->toArray() as $key => $value) {
            if (is_numeric($value) || !is_string($value)) {
                continue;
            }
            $model->$key = utf8_encode($value);
        }

        return $model;
    }
public static function utf8EncodeModel ( Model $ model ) { foreach ( $ model -> toArray ( ) as $ key => $ value ) { if ( is_numeric ( $ value ) || ! is_string ( $ value ) ) { continue ; } $ model -> $ key = utf8_encode ( $ value ) ; } return $ model ; }
UTF-8 encodes the attributes of a model.

@param Model $model
@return Model
UTF - 8 encodes the attributes of a model .