|string> */ public function rules(): array { // 최고관리자만 이름 수정 가능 $nameRule = auth()->user()->isSuperAdmin() ? 'required|string|max:100' : 'nullable'; return [ 'name' => $nameRule, 'phone' => 'nullable|string|max:20', ]; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'name' => '이름', 'phone' => '연락처', ]; } }