Magic Links


Magic links are a secure way to authenticate users without requiring a password. When a user requests a magic link, a unique URL is generated and sent to the user's email address. When the user clicks the link, they are automatically authenticated and redirected to your application.

Magic links are turned off by default

To enable magic links:

  1. Add this to your .env:
    ALLOW_MAGIC_LINK_LOGIN=true
  2. Run php artisan optimize


Users are now able to visit /login/magic-link and request a magic link.

magic-link


  1. If you want to use magic links as the default login method, go to /resources/js/Components/NavBar.vue
  2. Go to line 77 and change the href to /login/magic-link:
    <a href="/login/magic-link" class="-mx-3 block rounded-lg px-3 py-2.5 text-skin-muted font-semibold leading-7 text-gray-900 hover:opacity-90">Log in</a>