• Reading time ~ 3 min
  • 08.06.2022

Laravel Login Link is a Blade component to quickly login to your local environment.

After installing the login link package, logging in locally as an admin or normal user is as simple as adding the following blade snippet:

    <div class="space-y-2">
        <x-login-link email="[email protected]" label="Login as admin"/>
        <x-login-link email="[email protected]" label="Login as regular user"/>

By clicking a login link, you'll be logged in automatically without having to remember or enter any credentials. Your non-local environments won't render these links, but locally your login page might look like the following:

Spatie login link

According to Spatie's Freek Van der Herten, this package was imagined and created by Spatie to deal with seeded user credentials for various roles and a package built to share with the open-source community:

When developing an app with an admin section (or any non-public section), you'll likely seed test users to log in. In large teams that work on many different apps, it can be cumbersome to keep track of the right credentials. Is the user account "[email protected]", or "[email protected]", or even "[email protected]"? Is that password "password", "secret", or something else? How do I log in with a user that has a different role?

This package solves that problem by offering a component to render a login link. When clicked, you will be logged in.

Freek wrote a detailed introductory post on this package if you'd like to learn more about the background and use-case of this package. You can also learn more about setting up this package and view the source code on GitHub.


No comments yet
Yurij Finiv

Yurij Finiv

Full stack


Professional Fullstack developer with experience in website development and desktop development. I have experience with various tools and technologies such as Bootstrap, Tailwind, HTML5, CSS3, PUG, JS, AlpineJs, jQuery, PHP, MODX, Laravel, NodeJS, Git, Docker, hQuery, Guzzle, Livewire, Blade, Twig, Fenom, and Smarty. I have experience in website development using Symfony, MODX and Laravel. Experie...

Ukraine, Lutsk