name = $name; return $this; } public function label(string $label): self { $this->label = $label; return $this; } public function handler(string $handler): self { $this->handler = $handler; return $this; } public function form(DynamicForm $form): self { $this->form = $form; return $this; } public function register(): void { $providers = config('storage-provider.providers'); $providers[$this->name] = [ 'label' => $this->label, 'handler' => $this->handler, 'form' => $this->form ? $this->form->toArray() : [], ]; config(['storage-provider.providers' => $providers]); } }