/** * Handle a Logout Request * @return Response|Redirect */ public function getLogout(Request $request) { // Terminate the user's current session. Passing true as the // second parameter kills all of the user's active sessions. $result = $this->authManager->logout(null, null); // Return the appropriate response return $result->dispatch(route('utama')); }
/** @test */ public function it_handles_a_logout_request() { // Given $credentials = ['email' => '*****@*****.**', 'password' => 'password']; $result = $this->authManager->authenticate($credentials); // Attempt the Logout $result = $this->authManager->logout(); // Verify $this->assertInstanceOf(SuccessReply::class, $result); }