|string> */ public function rules(): array { return [ 'name' => 'required|string|max:100', 'email' => 'required|email|unique:users,email,' . Auth::id(), // Ensure the user ID is passed correctly 'no_telp' => 'required|string|max:20', 'password' => 'nullable|string|min:6', // Password is optional, only validated if present 'role_id' => 'required|exists:roles,id', // Ensures 'role_id' exists in the 'roles' table ]; } }