›
byrcsc/laravel-dev-login · 1.x
Install the package as a dev dependency, publish its config, and open the gates on your own machine.
Laravel Dev Login requires Laravel 12 or 13 on PHP 8.3 or 8.4. Install it as a development dependency:
composer require --dev byrcsc/laravel-dev-loginLaravel discovers DevLoginServiceProvider automatically. Nothing is exposed
yet: the package ships disabled, so installing it changes no behaviour.
--devis layer zero, not protection. Every safety gate is written on the assumption that a pipeline might ship dev dependencies anyway. Install it this way because it is correct, then rely on the gates.
php artisan vendor:publish --tag=dev-login-configThis writes config/dev-login.php with nine keys, all at their shipped
defaults. Configuration lists every one.
Add the flag to your own .env, not to .env.example and not to anything
that gets deployed:
DEV_LOGIN_ENABLED=trueThis is the only environment variable the package reads. Everything else lives in the config file.
allowed_hosts defaults to localhost, 127.0.0.1, and *.test. The check
runs against the host the request actually arrived on, so a hostname outside
that list gets a 404 even with everything else switched on.
Herd and Valet sites ending in .test are already covered. If you develop on
something else, add it:
'allowed_hosts' => ['localhost', '127.0.0.1', '*.test', 'app.ddev.site'],Entries are either an exact host or a leading-wildcard pattern such as
*.test, which matches subdomains only. A bare * matches nothing, and an
empty list allows nothing.
php artisan route:list --name=dev-login GET|HEAD dev-login dev-login.show › ByRcsc\LaravelDevLogin\Http\Controlle…
POST dev-login/{profile} dev-login.attempt › ByRcsc\LaravelDevLogin\H…
Showing [2] routesBoth routes appear only when the enable flag, the environment allowlist, and the production check all agree. An empty result means a gate said no, and Safety gates explains which.
At this point /dev-login renders and says that no profiles are configured.
| Variable | Default | Purpose |
|---|---|---|
DEV_LOGIN_ENABLED | false | The master switch read by enabled |
The gates are read while the application boots, and route registration is
decided there. Restart whatever serves the application after editing
config/dev-login.php or .env.
If the application caches its config, rebuild it:
php artisan config:cacheThe shipped config file survives caching. It contains no closures anywhere, which is why every seam in it is a class-string rather than a callback.
Gatekeeper answers whether the package may operate right now:
php artisan tinkerapp(ByRcsc\LaravelDevLogin\Gatekeeper::class)->passes(); // true
app(ByRcsc\LaravelDevLogin\Gatekeeper::class)->hostIsAllowed('localhost');passes() covers the three boot-time gates. hostIsAllowed() answers the
per-request one for a host you name.