{"id":19422848,"url":"https://github.com/dutchcodingcompany/filament-developer-logins","last_synced_at":"2025-04-05T00:05:25.461Z","repository":{"id":236284987,"uuid":"791813149","full_name":"DutchCodingCompany/filament-developer-logins","owner":"DutchCodingCompany","description":"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.","archived":false,"fork":false,"pushed_at":"2025-02-26T19:30:44.000Z","size":200,"stargazers_count":43,"open_issues_count":2,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T23:03:42.608Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DutchCodingCompany.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-25T12:24:30.000Z","updated_at":"2025-03-24T11:21:10.000Z","dependencies_parsed_at":"2024-12-16T09:22:14.201Z","dependency_job_id":"71b501ae-76b3-4823-ac36-62fd7d704b6c","html_url":"https://github.com/DutchCodingCompany/filament-developer-logins","commit_stats":{"total_commits":62,"total_committers":7,"mean_commits":8.857142857142858,"dds":"0.22580645161290325","last_synced_commit":"ed425d4955a6a5a37ad92028f725502b132250a6"},"previous_names":["dutchcodingcompany/filament-developer-logins"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DutchCodingCompany%2Ffilament-developer-logins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DutchCodingCompany%2Ffilament-developer-logins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DutchCodingCompany%2Ffilament-developer-logins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DutchCodingCompany%2Ffilament-developer-logins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DutchCodingCompany","download_url":"https://codeload.github.com/DutchCodingCompany/filament-developer-logins/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266562,"owners_count":20910836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T13:35:30.245Z","updated_at":"2025-04-05T00:05:25.445Z","avatar_url":"https://github.com/DutchCodingCompany.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filament Developer Logins\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/dutchcodingcompany/filament-developer-logins.svg?style=flat-square)](https://packagist.org/packages/dutchcodingcompany/filament-developer-logins)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/dutchcodingcompany/filament-developer-logins/run-test.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/dutchcodingcompany/filament-developer-logins/actions?query=workflow%3Arun-test+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/dutchcodingcompany/filament-developer-logins/php-cs-fixer.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/dutchcodingcompany/filament-developer-logins/actions?query=workflow%3A\"Fix+PHP+code+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/dutchcodingcompany/filament-developer-logins.svg?style=flat-square)](https://packagist.org/packages/dutchcodingcompany/filament-developer-logins)\n\nThis 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.\n\n![example-screenshot.png](https://raw.githubusercontent.com/DutchCodingCompany/filament-developer-logins/main/docs-assets/screenshots/example-screenshot.png)\n\n## Installation\n\nYou can install the package via composer.\n\n```bash\ncomposer require dutchcodingcompany/filament-developer-logins\n```\n\n## Usage\n\nRegister the plugin in the Filament panel provider (the default file is `app/Providers/Filament/AdminPanelProvider.php`).\n\nIn 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.\n\n\n```php\n// ...\n-\u003eplugins([\n    FilamentDeveloperLoginsPlugin::make()\n        -\u003eenabled()\n        -\u003eusers([\n            'Admin' =\u003e 'admin@example.com',\n            'User' =\u003e 'user@example.com',\n        ])\n]);\n```\n\nThe users() method can also be passed a closure to compute the users list at render time, for example from the database.\n\n```php\n// ...\nFilamentDeveloperLoginsPlugin::make()\n    -\u003eusers(fn () =\u003e User::pluck('email', 'name')-\u003etoArray())\n]);\n```\n\n## Customization\n\n### enabled()\n\nBy default, the plugin is disabled. You can enable it by calling the enabled() method. I strongly suggest enabling\nthis plugin only in the local environment. You can achieve this by using the app()-\u003eenvironment() method. Additionally, \nthe enabled() method also accepts a closure if you wish to enable the plugin based on a custom condition.\n\nExample:\n\n```php\n// ...\nFilamentDeveloperLoginsPlugin::make()\n    -\u003eenabled(app()-\u003eenvironment('local'))\n```\n\n### columns()\n\nTo customize the grid layout, you can use the columns() method. This method allows you to configure the grid layout based on your needs.\n\nBy 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.\n\nExample:\n\n```php\n// ...\nFilamentDeveloperLoginsPlugin::make()\n    -\u003ecolumns() // default 2\n```\n\nor you can use an array like this\n\n```php\n// ...\nFilamentDeveloperLoginsPlugin::make()\n        -\u003ecolumns([\n        'sm' =\u003e 3,\n        'xl' =\u003e 6,\n        '2xl' =\u003e 8,\n    ])\n```\n\n\n### switchable()\n\nBy default, a \"Switch to\" button is shown in the top right corner of the screen, so you can easily switch between the provided users. \nIf you want to disable this feature, you can use the switchable() method.\n\n```php\n// ...\nFilamentDeveloperLoginsPlugin::make()\n    -\u003eswitchable(false) // This also accepts a closure.\n```\n\n![switchable-screenshot.png](https://raw.githubusercontent.com/DutchCodingCompany/filament-developer-logins/main/docs-assets/screenshots/switchable-screenshot.png)\n\n### column()\n\nBy default, the user column is set to `email`. If you want to use a different column, you can use the column() method.\n\nExample:\n\n```php\nFilamentDeveloperLoginsPlugin::make()\n    -\u003ecolumn('name')\n```\n\n### modelClass()\n\nBy default, the model class is set to `App\\Models\\User`. If you want to use a different model, you can use the modelClass() method.\n\nExample:\n\n```php\nFilamentDeveloperLoginsPlugin::make()\n    -\u003emodelClass(Admin::class)\n```\n\n### redirectTo()\n\nBy 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.\n\n```php\nFilamentDeveloperLoginsPlugin::make()\n    -\u003eredirectTo('/custom-url')\n```\n\nSince the routes are not yet registered when the plugin is created, you need to use a closure to redirect to a named route.\n\n```php\nFilamentDeveloperLoginsPlugin::make()\n    -\u003eredirectTo(fn () =\u003e route('custom.route'))\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Bram Raaijmakers](https://github.com/bramr94)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdutchcodingcompany%2Ffilament-developer-logins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdutchcodingcompany%2Ffilament-developer-logins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdutchcodingcompany%2Ffilament-developer-logins/lists"}