$model */ public function __construct(protected string $model) { parent::__construct('Delete'.Str::pascal(class_basename($model))); } /** * Get the arguments for the create mutation. * * @return Argument[] */ public function arguments(): array { $arguments = []; $baseType = $this->baseType(); if ($baseType instanceof BaseType) { $arguments[] = $this->resolveBindArguments($baseType->fields()); } return Arr::flatten($arguments); } /** * The directives of the mutation. * * @return array */ public function directives(): array { return [ 'canModel' => [ 'ability' => 'delete', 'injectArgs' => true, 'model' => $this->model, ], ...parent::directives(), ]; } /** * The type returned by the field. */ public function getType(): Type { return Type::nonNull($this->baseType()); } }