›
byrcsc/laravel-dev-login · 1.x
Laravel Dev Login authenticates configured users through your application's session guards.
Laravel Dev Login lets you switch between configured users during development
without entering their credentials each time. Define a profile for each user
and session guard you need, visit /dev-login, and click a button to
authenticate:
// config/dev-login.php
'profiles' => [
'admin' => [
'label' => 'Admin',
'email' => 'admin@example.com',
],
'member' => [
'label' => 'Member',
'email' => 'member@example.com',
],
],Each profile becomes a button. Clicking one logs in the matching user without checking a password.
The package supports Laravel 12 and 13 on PHP 8.3 and 8.4.
| Laravel | Tested PHP versions |
|---|---|
| 12.x | 8.3, 8.4 |
| 13.x | 8.3, 8.4 |
Clicking a button posts to dev-login.attempt. The package then makes the
profile's tenant current if it names one, asks a resolver for the user the
profile points at, and hands that user to Laravel's session guard.
The last step is SessionGuard::login(), the same call Laravel's own login
makes. The session regenerates, the remember cookie is written if the profile
asked for one, and the Login event fires. Nothing about the session that
results is special.
That is why the package never writes to your users table and never touches a password. It resolves a user that already exists and drives the guard you already have.
A page that logs anybody in without a password has to be hard to reach by accident. Five checks decide whether it exists, and all five have to agree:
enabled flag, off by default.local and testing by default.The first four read your application's own configuration. The fifth does not,
which is what keeps the page shut when an .env file reaches a machine it
should not have. Safety gates covers each one.
TenantResolver contract and
no implementation, because only your tenancy package knows how a tenant
becomes current.For usage questions, start a GitHub discussion. For a reproducible defect, open an issue.