Download the PHP package dutchcodingcompany/filament-developer-logins without Composer
On this page you can find all versions of the php package dutchcodingcompany/filament-developer-logins. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dutchcodingcompany/filament-developer-logins
More information about dutchcodingcompany/filament-developer-logins
Files in dutchcodingcompany/filament-developer-logins
Package filament-developer-logins
Short Description Add buttons to the login page of Filament to login as a specific user.
License MIT
Homepage https://github.com/dutchcodingcompany/filament-developer-logins
Informations about the package filament-developer-logins
Filament Developer Logins
This plugin allows you to enable one-click logins for your local Filament panels, which is useful when developing a Filament project with multiple users and various roles.
Installation
You can install the package via composer.
Usage
Register the plugin in the Filament panel provider (the default file is app/Providers/Filament/AdminPanelProvider.php
).
In the users
method you can define the users (note: the users must exist), the key is used as a label on the login button and the value is used to search the user in the database.
Customization
enabled()
By default, the plugin is disabled. You can enable it by calling the enabled() method. I strongly suggest enabling this plugin only in the local environment. You can achieve this by using the app()->environment() method. Additionally, the enabled() method also accepts a closure if you wish to enable the plugin based on a custom condition.
Example:
columns()
To customize the grid layout, you can use the columns() method. This method allows you to configure the grid layout based on your needs.
By default, the columns() method sets the grid to 2 columns. You can adjust the default column count or specify different column counts for different screen sizes by passing an array.
Example:
or you can use an array like this
switchable()
By default, a "Switch to" button is shown in the top right corner of the screen, so you can easily switch between the provided users. If you want to disable this feature, you can use the switchable() method.
column()
By default, the user column is set to email
. If you want to use a different column, you can use the column() method.
Example:
modelClass()
By default, the model class is set to App\Models\User
. If you want to use a different model, you can use the modelClass() method.
Example:
RedirectTo()
By default, the user will be redirected using the Filament::getUrl()
method, which directs them to the dashboard. In the case of multi-tenancy, the user will also be redirected to the correct tenant. If you prefer to use a different url, you can utilize the redirectTo() method.
Since the routes are not yet registered when the plugin is created, you need to use a closure to redirect to a named route.
Testing
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
- Bram Raaijmakers
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-developer-logins with dependencies
filament/filament Version ^3.0
spatie/laravel-package-tools Version ^1.15.0