Download the PHP package koost89/laravel-login-links without Composer
On this page you can find all versions of the php package koost89/laravel-login-links. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download koost89/laravel-login-links
More information about koost89/laravel-login-links
Files in koost89/laravel-login-links
Package laravel-login-links
Short Description Generate a login URL / link to log in as a user
License MIT
Homepage https://github.com/koost89/laravel-login-links
Informations about the package laravel-login-links
Generate login links for users
Login links for Laravel is a package for Laravel 6, 7 and 8 that allows users to easily log in with a (one-time) login URL.
Quick example
Creating a link for a user works as follows:
Or you can generate a url with the authenticatable object
You can also use the command
Installation
You can install the package via composer:
You can publish the migration file with:
You can publish the config file with:
This is the contents of the published config file:
Usage
Default usage
By default Login Links expires the tokens after 120 seconds or after a visit to the URL.
These values can be changed in the config file located in config/login-links.php
.
To get started generating URL's for your users you must run the migration mentioned above.
In your User (or other authenticatable) class add the CanLoginWithLink
trait.
After this you can generate signed URL's with the following methods.
Or you can generate a url with the authenticatable object
You can also use the command
Authenticatable classes
Out of the box Login links uses the default web
guard to generate links for users.
If you haven't changed this in your application the default installation will work.
Custom guard
If your application uses a different guard than the default, you can specify this in the config in the auth.guard
key.
Multiple guards
If your application uses multiple guards with different models, you can change which guard
should be used for a specific model by override the getGuardName()
method.
For example:
Events
Events are dispatched on the following actions for you to listen to:
Koost89\LoginLinks\Events\LoginLinkGenerated
This event is fired when the URL is generated.
Koost89\LoginLinks\Events\LoginLinkUsed
This event is fired when the user is logged in after clicking on the link.
Commands
Login Links comes with a set of commands that will allow you to manage your links.
Generate Links
The login-links:generate
command takes an ID and an optional class (which by default is set to "App\Models\User") and returns
the generated URL for you.
If you have a different authenticatable class instead of the default you can specify it with the --class=
option.
For example:
Cleanup Links
The login-links:cleanup
command is helpful to clean up time-expired tokens from your database.
This package creates a record in the database for every URL that has been generated.
Once they are expired, they cannot be accessed anymore. So they no longer serve any purpose and can be discarded.
You can add this command in your scheduler for automatic cleanup.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Kevin Oosterveen
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-login-links with dependencies
illuminate/container Version ^6.0|^7.0|^8.0|^9.0
illuminate/contracts Version ^6.0|^7.0|^8.0|^9.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0
nesbot/carbon Version ^2.0