Getting tired of always entering login details in local dev environments? This package adds a button to instantly login a user!
Installation
You can install the package via composer:
composer require quintenbuis/laravel-instant-login
You can publish the config file with:
php artisan vendor:publish --provider="Quintenbuis\InstantLogin\InstantLoginServiceProvider" --tag="instant-login-config"
You can publish the views with:
php artisan vendor:publish --provider="Quintenbuis\InstantLogin\InstantLoginServiceProvider" --tag="instant-login-views"
This is the contents of the published config file:
return [
// The model that needs to be signed in
'model' => \App\Models\User::class,
// The guard where it must be signed in at
'guard' => 'web',
// Route information
'route' => [
'name' => 'instant-login',
'url' => '/instant-login',
],
// The fallback url when there is no intended route stored
'redirect' => null,
];
Usage
Add the login button to your view with:
<x-instant-login::button />
{{-- Adding custom classes --}}
<x-instant-login::button class="bg-red-600" />
And it will login the first user it finds.
The instant login button protects against production environments by default.
If you want to customize which user to get you can add the following to (for example) your AppServiceProvider
:
InstantLogin::filterUsing([
['email' => 'quinten.buis@gmail.com'],
['admin' => true]
]);
This will be going through the where()
method on the model.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.