public function setModel($model)
    {
        if (is_string($model)) {
            $model = $this->factory()->get($model);
        }

        if (!$model instanceof ModelInterface) {
            throw new InvalidArgumentException(
                sprintf(
                    'The model must be an instance of "%s"',
                    ModelInterface::class
                )
            );
        }

        $this->model = $model;

        $this->setSource($model->source());

        return $this;
    }