validate([ 'name' => ['required', 'string', 'max:255', 'unique:lecturers,name'], 'subtitle' => ['nullable', 'string'], 'intro' => ['nullable', 'string'], 'description' => ['nullable', 'string'], 'active' => ['boolean'], 'website' => ['nullable', 'url', 'max:255'], 'twitter_username' => ['nullable', 'string', 'max:255'], 'nostr' => ['nullable', 'string', 'max:255'], 'lightning_address' => ['nullable', 'string'], 'lnurl' => ['nullable', 'string'], 'node_id' => ['nullable', 'string', 'max:255'], 'paynym' => ['nullable', 'string'], ]); $lecturer = Lecturer::create($validated); if ($this->avatar) { $lecturer ->addMedia($this->avatar->getRealPath()) ->usingName($lecturer->name) ->toMediaCollection('avatar'); } session()->flash('status', __('Dozent erfolgreich erstellt!')); $this->redirect(route_with_country('lecturers.edit', ['lecturer' => $lecturer]), navigate: true); } }; ?>