Download the PHP package notion/swaycookie without Composer
On this page you can find all versions of the php package notion/swaycookie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download notion/swaycookie
More information about notion/swaycookie
Files in notion/swaycookie
Package swaycookie
Short Description A custom Laravel authentication package with Redis and database fallback for API authentication.
License MIT
Informations about the package swaycookie
Notion Sway
What is Included:
- Project Introduction: Brief overview of the package.
- Features: Key features of the package listed in bullet points.
- Installation: Step-by-step guide to install and publish the configuration file.
- Usage: How to configure and use the package in your Laravel project.
- Configuration: Details of the
config/sway.phpfile and how to adjust settings. - Contribute: How users can contribute to the project.
- License: Specifies that the package is licensed under the MIT License.
🎉 Notion Sway is a custom Laravel authentication package that provides a flexible JWT-based authentication system with database fallback options for API authentication.
Features
- JWT token-based API authentication: Secure API authentication with JWT tokens.
- Redis and database fallback authentication methods: Provides fallback methods in case the primary authentication method fails.
- Customizable guards: Easily customize authentication guards and configuration.
- Middleware to protect routes: Use middleware to protect routes with custom authentication.
- Easy integration into Laravel: Quick and simple integration into your existing Laravel applications.
- Fully configurable: Configure JWT token expiration time and token prefix.
- Flexible authentication: Supports multiple authentication methods (Redis, Database).
Installation
To install the package, run the following command in your Laravel project:
Installation
Usage
Configure Authentication Guard
In your config/auth.php file, configure the sway guard by adding it to the guards array:
Protect Routes with Middleware
In your routes/web.php or routes/api.php file, set authorized middleware then pass the guard to middleware. This is required to get correct auth user while in controller:
Generate token
In order to generate token call attempt() method on the guard
- Important: Make sure to pass array and must hold email and password data.
- Output: After success it will return
access_tokenandrefresh_token.
Get Authenticated User
To obtain the auth user you can get through Guard or Request:
- OR:
Invalidate Token
-
Update Model: use
InvalidatableTokenon your model: - Clear Token: call
invalidateTokento delete token:
Contributors
All versions of swaycookie with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/auth Version ^8.0|^9.0|^10.0|^11.0|^12.0
firebase/php-jwt Version ^6.11
jenssegers/agent Version ^2.6