/laravel-logout

Package for Laravel Logout

Primary LanguageJavaScriptMIT LicenseMIT

laravel-logout

Package for Laravel Logout

Installation

npm install laravel-logout

This package need X-CSRF-TOKEN, add this code to your header template

<meta name="csrf-token" content="{{ csrf_token() }}">

In your app.js, add this code

require('laravel-logout');

Usage

In your blade template

<a laravel-logout>Logout</a>

The default logout url use logout route from laravel ('/logout'). If you have different logout url, use data-action attribute

<a laravel-logout data-action="your-logout-url">Logout</a>