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.'); } /** * The arguments of the class resolve as customs class helper. * * @return Argument[] */ public function arguments(): array { $arguments = parent::arguments(); if (in_array(new DeletedAtField(), $this->baseType()->fieldClasses())) { $arguments[] = new TrashedArgument(); } return Arr::flatten($arguments); } protected function query(Builder $builder, array $args): Builder { return $builder; } }