Home Source code Login links for your Laravel application during development

Login links for your Laravel application during development


Laravel Login link is a Blade component to quickly connect to your local environment.

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


2 <div class="space-y-2">

3 <x-login-link email="[email protected]" label="Login as admin"/>

4 <x-login-link email="[email protected]" label="Login as regular user"/>

5 div>


Clicking on a login link will automatically log you in without having to remember or enter any credentials. Your non-local environments will not display these links, but your local login page might look like this:

According to Freek Van der Herten of Spatie, this package was envisioned and created by Spatie to manage predefined user credentials for various roles and a package designed to be shared with the open source community:

When developing an app with an admin section (or any other non-public section), you’ll likely have test users to login. In large teams that work on many different applications, it can be cumbersome to keep track of the correct credentials. Is the user account “[email protected]”, or “[email protected]”, or even “[email protected]”? Is this password “password”, “secret” or something else? How can I log in with a user who has a different role?

This package solves this problem by providing a component to render a login link. When you click on it, you will be connected.

freek wrote a detailed introductory article about this package if you want to know more about the background and use case of this package. You can also read more about configuring this package and view the source code on GitHub.