user()->can('update', $this->route('course')); } /** * @return array> */ public function rules(): array { return [ 'name' => ['sometimes', 'required', 'string', 'max:255'], 'lecturer_id' => ['sometimes', 'required', 'integer', 'exists:lecturers,id'], 'description' => ['sometimes', 'nullable', 'string'], ]; } /** * @return array */ public function messages(): array { return [ 'lecturer_id.exists' => 'Der angegebene Referent existiert nicht.', ]; } }