›
byrcsc/laravel-dev-login · 1.x
Every key in config/dev-login.php, its type, its default, and what reads it.
php artisan vendor:publish --tag=dev-login-configconfig/dev-login.php holds nine keys. Five of them are safety gates, three
are seams for classes of your own, and one is the profile list.
return [
'enabled' => (bool) env('DEV_LOGIN_ENABLED', false),
'environments' => ['local', 'testing'],
'allowed_hosts' => ['localhost', '127.0.0.1', '*.test'],
'path' => 'dev-login',
'middleware' => ['web'],
'profiles' => [],
'resolver' => null,
'tenant_resolver' => null,
'default_redirect' => null,
];The file contains no closures anywhere, so it survives config:cache. Every
seam in it is a class-string for that reason.
| Key | Type | Default | Purpose |
|---|---|---|---|
enabled | bool | false | The master switch, read from DEV_LOGIN_ENABLED |
environments | list of strings | ['local', 'testing'] | Environments the package may run in; production is refused |
allowed_hosts | list of strings | ['localhost', '127.0.0.1', '*.test'] | Hosts the page answers on, checked per request |
path | non-empty string | dev-login | The URI both routes live under |
middleware | array | ['web'] | Applied to both routes, ahead of the host gate |
profiles | array keyed by name | [] | The profiles the page shows |
resolver | class-string or null | null | Default UserResolver; null uses FindUserByEmail |
tenant_resolver | class-string or null | null | TenantResolver for tenant-bound profiles |
default_redirect | string or null | null | Fallback destination; null falls through to / |
enabledOff by default, and separate from environments on purpose. Both have to say
yes. Setting it while APP_ENV=production throws
DevLoginEnabledInProduction at boot.
environmentsMatched case-sensitively against app()->environment(). Adding production
here does not work, because the production check is asked separately.
A value this key cannot read as a list is treated as an empty list, which shuts the gate.
allowed_hostsEntries are exact hosts or leading-wildcard patterns. *.test matches
acme.test and tenant.acme.test, but not test. A bare * matches
nothing, and an empty list allows nothing. Matching is case-insensitive.
pathMust be a non-empty string. Anything else throws InvalidConfiguration::path
while routes register. The route names stay dev-login.show and
dev-login.attempt whatever the path is.
middlewareMust be an array. web is required in practice: the session guard needs a
session and the POST route relies on that group for CSRF. The host gate is
appended after this list.
profilesKeyed by the route parameter. Each value is an array accepting label,
email, guard, remember, tenant, redirect, resolver, and
fire_login_event. Any other key throws. See Profiles.
resolver and tenant_resolverClass-strings implementing UserResolver and TenantResolver. Both are
built through the container, and both throw InvalidConfiguration naming the
key when the class does not implement the contract.
tenant_resolver is only ever reached by a profile that names a tenant.
default_redirectThird in the redirect order, after the profile's own redirect and the
session's intended URL.
| Variable | Reads into | Default |
|---|---|---|
DEV_LOGIN_ENABLED | enabled | false |
This is the only variable the package defines. Everything else is edited in the config file, where the change is visible in a diff.
| Tag | Writes |
|---|---|
dev-login-config | config/dev-login.php |
dev-login-views | resources/views/vendor/dev-login/ (page and component) |
The package ships no migrations, because it writes no schema of its own.
| Class | Role |
|---|---|
ByRcsc\LaravelDevLogin\Gatekeeper | Answers passes(), mustRefuseToBoot(), hostIsAllowed() |
ByRcsc\LaravelDevLogin\ProfileRepository | all(), groupedByTenant(), find() |
ByRcsc\LaravelDevLogin\Authenticator | login(Profile): Authenticatable |
ByRcsc\LaravelDevLogin\Profile | Readonly value object, hasTenant() |
ByRcsc\LaravelDevLogin\Contracts\UserResolver | resolve(Profile): ?Authenticatable |
ByRcsc\LaravelDevLogin\Contracts\TenantResolver | makeCurrent(Profile): void |
ByRcsc\LaravelDevLogin\Resolvers\FindUserByEmail | The shipped user resolver |
ByRcsc\LaravelDevLogin\Http\Middleware\EnsureHostIsAllowed | The host gate, aliased dev-login.host |
DevLoginServiceProvider::HOST_MIDDLEWARE holds the alias string, so a route
of your own can reference it without repeating the literal.
profiles.