A Laravel package that generates secure, signed login links for authenticating users via the command line. Perfect for development, testing, or providing customer support access.
You can install the package via composer:
composer require caesardev/laravel-login-commandYou can publish the config file with:
php artisan vendor:publish --tag="login-command-config"This is the contents of the published config file:
return [
'expiration' => 60,
'guard' => null,
'redirect_url' => '/',
'route_name' => 'login-link',
'user_model' => 'App\\Models\\User',
];Generate a signed login link for a user by their ID:
php artisan login:link 1Or by their email:
php artisan login:link user@example.comThe command will output a signed URL that you can click or copy and paste into your browser to authenticate as that user.
--guard: Specify the authentication guard to use
php artisan login:link 1 --guard=admin--redirect: Specify where to redirect after login
php artisan login:link 1 --redirect=/dashboard--expires: Set how many minutes the link remains valid (default: 60)
php artisan login:link 1 --expires=120- expiration: Default number of minutes the login link is valid (default: 60)
- guard: Default authentication guard to use (default: null, uses default guard)
- redirect_url: Default URL to redirect to after login (default: '/')
- route_name: Name of the login route (default: 'login-link')
- user_model: The User model class to use (default: 'App\Models\User')
composer testPlease see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.