Skip to content

Commit

Permalink
Adding the logout controller to the package
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed Apr 17, 2024
1 parent 869c15b commit 9ba7ecc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 1 addition & 2 deletions routes/web.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use App\Http\Controllers\Auth\EmailVerificationController;
use App\Http\Controllers\Auth\LogoutController;
use Devdojo\Auth\Http\Controllers\LogoutController;
use Illuminate\Support\Facades\Route;

// Create redirect routes for common authentication routes
Expand Down
17 changes: 17 additions & 0 deletions src/Http/Controllers/LogoutController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Devdojo\Auth\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Auth;

class LogoutController extends Controller
{
public function __invoke(): RedirectResponse
{
Auth::logout();

return redirect()->route('home');
}
}

0 comments on commit 9ba7ecc

Please sign in to comment.