protected function resolveModel($data):Model
    {
        if ($data instanceof Model) {
            return $data;
        }

        $model = array_values($data)[0];
        if (! $model instanceof Model) {
            throw new InvalidArgumentException('You can only transform data containing Eloquent models.');
        }

        return $model;
    }
protected function resolveModel($data):Model
    {
        if ($data instanceof Model) {
            return $data;
        }

        $model = array_values($data)[0];
        if (! $model instanceof Model) {
            throw new InvalidArgumentException('You can only transform data containing Eloquent models.');
        }

        return $model;
    }
protected function resolveModel ( $ data ) : Model { if ( $ data instanceof Model ) { return $ data ; } $ model = array_values ( $ data ) [ 0 ] ; if ( ! $ model instanceof Model ) { throw new InvalidArgumentException ( 'You can only transform data containing Eloquent models.' ) ; } return $ model ; }
Resolve a model instance from the data.

@param  \Illuminate\Database\Eloquent\Model|array $data
@return \Illuminate\Database\Eloquent\Model
@throws \InvalidArgumentException
Resolve a model instance from the data .