middleware = array_merge( $this->middleware, [ ResolveBindableArgs::class, ], ); parent::__construct($name, $nullable, $isList); } /** * @return array */ public function attributes(): array { return [ ...parent::attributes(), 'model' => $this->model(), ]; } /** * Get the model related to the query. * * @return class-string * * @throws Exception */ public function model(): string { $baseType = $this->baseType(); if ($baseType instanceof EloquentType) { return $baseType->model(); } throw new RuntimeException('The base return rebing type must be an instance of EloquentType, '.($baseType instanceof BaseType ? $baseType::class : self::class).' given.'); } protected function query(Builder $builder, array $args): Builder { return $builder; } }