title: How to solve logout issue in Laravel 7?
body: <p>I have been looking for answer and tried many answer from the community here, but none of them seems to work in my case.
  All was working before migration from Bootstrap to TailwindCss, now when i click logout, nothing happens.
  I'm not sure if it's a javascript related issue, i hope you guys can help me with this.</p>
  <pre><code>auth.blade.php
  
  &lt;div class=&quot;hidden md:flex items-center justify-end space-x-8 md:flex-1 lg:w-0&quot;&gt;
      &lt;span class=&quot;inline-flex rounded-md shadow-sm&quot;&gt;
         &lt;a href=&quot;{{ route('logout') }}&quot;
            onclick=&quot;event.preventDefault(); document.getElementById('logout-form').submit();&quot;
              class=&quot;whitespace-no-wrap inline-flex items-center justify-center px-4 py-2 border border-transparent text-base leading-6 font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:border-indigo-700 focus:shadow-outline-indigo active:bg-indigo-700 transition ease-in-out duration-150&quot;&gt;
             {{ __('Logout') }}
         &lt;/a&gt;
           &lt;form id=&quot;logout-form&quot; action=&quot;{{ route('logout') }}&quot; method=&quot;POST&quot; style=&quot;display: none;&quot;&gt;
             @csrf
           &lt;/form&gt;
      &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  <pre><code>
  Auth::routes();
  
  Route::get('/login/applicant', 'Auth\LoginController@showApplicantLoginForm')-&gt;name('login');
  Route::get('/login/employer', 'Auth\LoginController@showEmployerLoginForm');
  Route::get('/register/applicant', 'Auth\RegisterController@showApplicantRegisterForm')-&gt;name('register');
  Route::get('/register/employer', 'Auth\RegisterController@showEmployerRegisterForm');
  // route::post('/logout', 'Auth\LoginController@logout')-&gt;name('logout');
  
  
  Route::post('/login/applicant', 'Auth\LoginController@applicantLogin');
  Route::post('/login/employer', 'Auth\LoginController@employerLogin');
  Route::post('/register/applicant', 'Auth\RegisterController@createApplicant');
  Route::post('/register/employer', 'Auth\RegisterController@createEmployer');
  
  </code></pre>
  <pre><code>Auth/LoginController.php
  
  &lt;?php
  
  namespace App\Http\Controllers\Auth;
  
  use App\Http\Controllers\Controller;
  use App\Providers\RouteServiceProvider;
  use Illuminate\Foundation\Auth\AuthenticatesUsers;
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Auth;
  
  class LoginController extends Controller
  {
      /*
      |--------------------------------------------------------------------------
      | Login Controller
      |--------------------------------------------------------------------------
      |
      | This controller handles authenticating users for the application and
      | redirecting them to your home screen. The controller uses a trait
      | to conveniently provide its functionality to your applications.
      |
      */
  
      use AuthenticatesUsers;
  
      /**
       * Where to redirect users after login.
       *
       * @var string
       */
      protected $redirectTo = RouteServiceProvider::HOME;
  
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('guest')-&gt;except('logout');
          $this-&gt;middleware('guest:applicant')-&gt;except('logout');
          $this-&gt;middleware('guest:employer')-&gt;except('logout');
      }
  
      public function showApplicantLoginForm()
      {
          return view('auth.login', ['url' =&gt; 'applicant']);
      }
  
      public function applicantLogin(Request $request)
      {
          $this-&gt;validate($request, [
              'email' =&gt; 'required|email',
              'password' =&gt; 'required|min:6'
          ]);
  
          if (Auth::guard('applicant')-&gt;attempt([
              'email' =&gt; $request-&gt;email,
              'password' =&gt; $request-&gt;password
          ], $request-&gt;get('remember'))) {
              return redirect()-&gt;intended('/applicant');
          }
          return back()-&gt;withInput($request-&gt;only('email', 'remember'));
      }
  
      public function showEmployerLoginForm()
      {
          return view('auth.login', ['url' =&gt; 'employer']);
      }
  
      public function employerLogin(Request $request)
      {
          $this-&gt;validate($request, [
              'email' =&gt; 'required|email',
              'password' =&gt; 'required|min:6'
          ]);
  
          if (Auth::guard('employer')-&gt;attempt([
              'email' =&gt; $request-&gt;email,
              'password' =&gt; $request-&gt;password
          ], $request-&gt;get('remember'))) {
              return redirect()-&gt;intended('/employer');
          }
          return back()-&gt;withInput($request-&gt;only('email', 'remember'));
      }
  }
  </code></pre>