where('workspace_id', $workspace->id) ->firstOrFail(); $this->bioUlid = $bioUlid; $this->title = $bio->getTranslation('title', 'en') ?? ''; $this->slug = $bio->slug; $this->isPublished = $bio->is_published; } protected function rules(): array { return [ 'title' => 'required|max:200', 'slug' => 'nullable|alpha_dash|max:80', 'isPublished' => 'boolean', ]; } public function save(): void { $this->validate(); $workspace = app('current_workspace'); $bio = BioPage::where('ulid', $this->bioUlid) ->where('workspace_id', $workspace->id) ->firstOrFail(); $bio->update([ 'title' => ['en' => $this->title, 'de' => $this->title], 'slug' => $this->slug ?: $bio->slug, 'is_published' => $this->isPublished, ]); $this->dispatch('bioPageUpdated', bioUlid: $this->bioUlid); $this->dispatch('toast', message: 'Bio Page aktualisiert', type: 'success'); $this->closeModal(); } public static function modalMaxWidth(): string { return 'md'; } public function render(): View { return view('livewire.modals.edit-bio-page'); } }