*/ public function rules(): array { $managed = $this->user()->managedFields(); return [ 'first_name' => [in_array('first_name', $managed, true) ? 'nullable' : 'required', 'string', 'max:100'], 'last_name' => [in_array('last_name', $managed, true) ? 'nullable' : 'required', 'string', 'max:100'], 'email' => [ in_array('email', $managed, true) ? 'nullable' : 'required', 'string', 'lowercase', 'email', 'max:255', Rule::unique('users')->ignore($this->user()->id), ], 'job_title' => ['nullable', 'string', 'max:150'], 'department' => ['nullable', 'string', 'max:150'], 'location' => ['nullable', 'string', 'max:150'], 'phone' => ['nullable', 'string', 'max:50'], 'mobile' => ['nullable', 'string', 'max:50'], 'about' => ['nullable', 'string', 'max:2000'], ]; } /** * @return array */ public function attributes(): array { return [ 'first_name' => 'Vorname', 'last_name' => 'Nachname', 'email' => 'E-Mail-Adresse', 'job_title' => 'Funktion', 'department' => 'Abteilung', 'location' => 'Standort', 'phone' => 'Telefon', 'mobile' => 'Mobil', 'about' => 'Über mich', ]; } }