Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Magiclink

Laravel Magiclink Laravel Package

cesargb/laravel-magiclink

Laravel package for passwordless authentication: generate signed, temporary magic links tied to a user, validate them, and enforce usage limits or expiration. Offers a simple API for creating and consuming links, with middleware support for login and verification flows.

View on GitHub
Deep Wiki
Context7

Laravel MagicLink enables passwordless authentication by generating secure, time-limited magic links for your Laravel application. Users can log in or perform custom actions without passwords, while links are stored in the database and invalidated after use or expiration.

  • Create secure magic links for any user with configurable expiration
  • Single-use links that automatically invalidate after access
  • Built-in login flow with route and middleware support
  • Send links via Laravel notifications or custom delivery
  • Support for custom actions beyond authentication
Frequently asked questions about Laravel Magiclink
What is cesargb/laravel-magiclink used for?
It creates magic links that let users authenticate in a Laravel application without a password, or access private content. You generate a link for a user and the package handles token validation and login. It fits passwordless login flows, invitations, and one-time private URLs.
How do I install cesargb/laravel-magiclink in Laravel?
Install it with Composer using composer require cesargb/laravel-magiclink. Laravel auto-discovers the service provider, and you can publish the package configuration if you need to customize defaults. After that, generate links through the MagicLink facade or class.
How do I create a magic link for a user in Laravel?
Use the MagicLink facade or class and pass the authenticatable user model to create a link. The returned object exposes the generated URL, which you can email or deliver to the user. The URL contains a secure token tied to that user.
Does laravel-magiclink support passwordless login out of the box?
Yes, the package is designed for passwordless authentication. A valid magic link logs the associated user into the configured guard. You can customize redirects and post-login behavior through the package configuration.
How do I configure magic link expiration and usage limits?
Publish the package configuration file and adjust the expiration and visit limit settings. Links should be short-lived and limited to prevent reuse. Review the expires_in and max_visits options to match your security requirements.
Can I use laravel-magiclink to protect private content instead of login?
Yes, the package can generate links for accessing private content, not only for authentication. You can validate the magic link before showing protected resources or running a restricted action. This makes it useful for one-time downloads, invitations, and gated pages.
Which Laravel versions does cesargb/laravel-magiclink support?
The package supports modern Laravel versions, but the exact range depends on the release. Check the composer.json and README on GitHub for the current version constraints before upgrading. Laravel package auto-discovery works on the supported versions.
Is laravel-magiclink secure for production use?
Magic links are bearer tokens, so treat them like passwords. Use HTTPS, short expiration times, single-use limits, and avoid logging the full URLs. The package provides token validation and configurable limits, but you must secure delivery and storage.
How do I test magic link authentication in Laravel?
Use Laravel testing helpers to generate a link for a factory-created user and visit the URL. Assert that the user is authenticated and redirected as expected. You can also freeze time to test expiration and reuse limits.
What are alternatives to cesargb/laravel-magiclink?
Alternatives include Laravel signed URLs for temporary access, custom passwordless login with signed routes, or other magic link packages. Choose based on whether you need full authentication, token limits, and event hooks. cesargb/laravel-magiclink bundles these concerns for you.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo