name($name); } public static function make(?string $name = null): static { $actionClass = static::class; $name ??= static::getDefaultName(); if (blank($name)) { throw new Exception("Action of class [$actionClass] must have a unique name, passed to the [make()] method."); } $static = app($actionClass, ['name' => $name]); $static->configure(); return $static; } public static function getDefaultName(): ?string { return null; } /** * @deprecated Use `->extraAttributes()` instead. */ public function withAttributes(array $attributes): static { return $this->extraAttributes($attributes); } }