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 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

Technical Evaluation

Architecture fit

  • Laravel-native and idiomatic: one service provider, a publishable config file, a single migration (magic_links table), a middleware, a controller, and a Magiclink facade. Nothing exotic — no queue dependency, no external service, no separate auth server.
  • Fits the "signed URL + persisted token" pattern most Laravel teams already understand (URL::temporarySignedRoute semantics plus a hashed token row, usage counters, and expiry).
  • Two distinct use cases in one primitive: auth (passwordless login) and link (grant access to private content/downloads). That breadth is useful for internal admin tools, customer portals, invite flows, and one-time document delivery — and it is also why the package stays thin: it deliberately stops short of session management, mail delivery, and UI.
  • It is a primitive, not a product. There is no mailer, no login guard wiring, no rate limiting, no error pages, no revocation UI. A TPM must budget for those as application work, not package work.
  • The low opportunity score is consistent with the scope: a narrow, largely solved niche in a mature ecosystem, with Laravel Fortify/Breeze and hand-rolled signed URLs as substitute goods.

Integration feasibility

  • Very low integration cost: composer require, publish config + migration, migrate, define the middleware-protected route, implement the post-validation callback. A competent Laravel developer can spike this in under a day.
  • The real effort sits adjacent to the package: transactional email templates and deliverability, throttling, user-facing error states, audit logging, and deciding what "logged in" means for our guard.
  • Works equally well in a monolith (redirect + session) and a headless API (link exchange for a token), but the API path requires us to write the exchange endpoint ourselves.

Technical risk

  • Bus-factor risk: single maintainer, ~469 stars, no dependents reported. The dependents figure is likely a Packagist/GitHub counting artifact rather than true zero adoption, but we should not treat it as a signal of maturity either way.
  • Semver discipline to verify: v2.29.0 deprecates running magic links without MagiclinkMiddleware. Tightening security posture inside a minor release is defensible, but it foretells a v3 that removes the old path. Pin the version and read the upgrade notes before every bump.
  • Metadata anomaly: the listed last release date (2026-09-28) is in the future. Treat all release-cadence and maintenance-activity claims as unverified until we check Packagist and the commit history directly.
  • Bearer-token semantics: the link is not bound to a device, IP, or session. Forwarded email = forwarded access. Acceptable for low-sensitivity content, unacceptable for anything regulated without an additional factor.
  • Key/URL coupling: signatures depend on APP_KEY and APP_URL. Key rotation invalidates every outstanding link; misconfigured proxies or load balancers break signature validation in ways that look like "the package is broken."
  • No built-in throttling or issuance controls — the package will happily mint unlimited links, which is an email-bombing and cost-abuse vector if we expose an endpoint that triggers sends.
  • Low code surface is the mitigation: the package is small enough to vendor, fork, or reimplement internally. That caps the downside of abandonment.

Key questions

  1. Which flows are in scope — login, invite/onboarding, private content, one-time downloads — and do they have different TTL and reuse requirements?
  2. How do we establish the session after validation? Do we call Auth::login() in our callback, and does that interact correctly with our existing guard, remember-me, and 2FA policy?
  3. Are tokens revocable before expiry (logout-everywhere, offboarding, leaked email)? If yes, what's our admin surface?
  4. What is the TTL policy, and does it survive realistic queue and delivery delay?
  5. Do we need user/tenant binding, IP pinning, or an additional factor for sensitive content?
  6. What are the exact Laravel and PHP version constraints, and do they match our supported matrix today and at next upgrade?
  7. Who owns this internally, and do we accept single-maintainer upstream risk, or plan to vendor the source from day one?

Integration Approach

Stack fit

  • Laravel 9/10/11-class applications on PHP 8.x, with a relational database (MySQL, Postgres, SQLite all fine) for the magic_links table.
  • Complements rather than replaces Fortify/Breeze: keep existing auth scaffolding, add magic-link as an additional route and guard path, and gate it behind a feature flag.
  • Email is entirely our responsibility. Any transactional provider (SES, Postmark, Mailgun) works; the integration work is the Mailable, the template, and the deliverability setup (SPF/DKIM/DMARC, dedicated subdomain), not the package.
  • If the app is behind a CDN or load balancer, confirm trusted-proxy and forced-scheme configuration before the spike, not after — this is the most common false-negative during first integration.

Migration path

  • Greenfield: publish config and migration, run it, add the middleware-protected route, implement the callback, ship behind a flag.
  • Replacing a homegrown signed-URL or "token in query string" implementation: run both in parallel, dual-issue links during the transition window, and drain outstanding legacy links before removal. Plan for a period where users hold links from both systems.
  • Upgrading from v1 to v2: there are schema and API differences. Treat it as a coordinated upgrade with a migration and a compatibility shim, not a composer update.
  • Upgrading within v2: pin to a minor and review changelogs; the v2.29.0 middleware deprecation should be adopted proactively so we are already on the future-required path.

Compatibility

  • Verify the support matrix against our target Laravel and PHP versions and re-verify at every framework major upgrade — small packages often lag a Laravel major by weeks or months.
  • APP_KEY rotation and APP_URL drift are deployment-level compatibility hazards; add a smoke test that generates a link and follows it in staging after every deploy.
  • Middleware ordering matters: place magiclink in the web group intentionally and confirm interaction with CSRF, session, and any global auth middleware.
  • Config caching in production means config changes require a deploy or config:cache refresh — document this in the runbook.

Sequencing

  1. Spike in a branch: internal-only route, single happy path, confirm signed-URL behavior behind our actual proxy/CDN.
  2. Policy decisions: TTL, max uses, bind-to-user-or-not, revocation requirement, error UX. Write these down before coding.
  3. Delivery layer: Mailable, template, provider config, deliverability checks.
  4. Abuse controls: route throttling on issuance, issuance authorization (only authenticated or explicitly invited users can trigger a send), and per-recipient caps.
  5. Auth wiring: callback that validates and establishes the session under the correct guard; decide interaction with 2FA and remember-me.
  6. Observability and tests: cases for expired, already-used, tampered, wrong-host, and rotated-key links; metrics on issue/click/success/expiry.
  7. Rollout: feature-flagged cohort, then broader; keep the password path until magic-link success rate is proven.

Operational Impact

Maintenance

  • Low ongoing code maintenance, but non-zero dependency maintenance: pin the version, subscribe to releases, and schedule review alongside our Laravel major upgrades.
  • Single-maintainer risk is real but bounded: the source is small enough that an internal fork or clean reimplementation is a credible fallback. Decide the trigger for that fallback (e.g., six months without a release or a Laravel major unsupported) and write it down.
  • Watch the deprecation trajectory: the middleware is becoming mandatory. Adopt it now so a future v3 is a non-event.
  • Add a scheduled cleanup job to prune expired rows, and index expires_at — the table grows monotonically with every link issued.

Support

  • No vendor support; community issues only. Assign an internal owner explicitly, otherwise it becomes orphaned infrastructure.
  • Expect a specific and recurring support ticket class: "the link doesn't work." Build the runbook to distinguish expired, already used, tampered/signature mismatch, wrong host, and purged record — and log these distinctly so support can triage without engineering.
  • Deliverability failures will be reported as product bugs. Route them to the email provider's telemetry first.

Scaling

  • Read path is one indexed lookup plus a signature check per click — effectively free at any volume we are likely to see.
  • Write path scales with issuance, not usage. Bulk invite or campaign flows are the pressure point; batch issuance and consider queueing sends.
  • The genuine bottleneck and cost center is email sending, not the package. Rate-limit and budget there.
  • For high-traffic issuance, add a per-user and per-tenant issuance cap at the application layer; the package will not do this for you.

Failure modes

  • Link prefetch/scanning consuming single-use links — corporate mail security scanners and chat unfurlers will click the link before the user does. This is the single most common real-world failure. Mitigate with num_max_uses > 1, or a GET confirmation interstitial, or a POST-to-consume step.
  • APP_KEY rotation silently invalidating all outstanding links — coordinate rotation with a drain window.
  • Proxy/CDN misconfiguration producing valid-looking links that fail signature validation.
  • Clock skew across app servers causing premature expiry or early acceptance.
  • Cleanup job racing expiry — ensure the prune threshold is strictly past expires_at.
  • Forwarded or leaked email granting access to the wrong party (bearer-token semantics).
  • Unthrottled issuance enabling email bombing and provider cost/abuse exposure.
  • Differing error messages leaking account existence — normalize the "no such user" and "link sent" responses.
  • In-flight links lost during a v1→v2 cutover if the drain step is skipped.

Ramp-up

  • A mid-level Laravel developer is productive in one to two days on the package itself; the calendar time is dominated by email setup, policy decisions, abuse controls, and UX for error states.
  • Documentation is adequate for the happy path and thin on edge cases (revocation, multi-guard, error handling) — plan for the team to document their own integration notes.
  • The main conceptual learning is Laravel signed URLs and middleware ordering, which are transferable skills, not package-specific lock-in.
  • Recommended first milestone is a feature-flagged internal pilot with full metrics, so the scanner-prefetch and deliverability failure modes surface before external users see them.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource