{"id":15016789,"url":"https://github.com/discoverydesign/filament-locksmith","last_synced_at":"2026-03-07T23:02:21.766Z","repository":{"id":251955236,"uuid":"838911687","full_name":"discoverydesign/filament-locksmith","owner":"discoverydesign","description":"🔒 Passwords inputs made easy in Filament PHP 🤫","archived":false,"fork":false,"pushed_at":"2025-09-26T09:07:11.000Z","size":137,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-26T11:20:58.262Z","etag":null,"topics":["filament-plugin","filamentadmin","filamentphp","filamentphp-plugin","laravel","livewire"],"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/discoverydesign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-06T15:25:57.000Z","updated_at":"2025-09-26T09:06:56.000Z","dependencies_parsed_at":"2024-08-06T20:30:10.897Z","dependency_job_id":"d0ebd4e2-ecfa-48ac-b1da-611d7f30ff07","html_url":"https://github.com/discoverydesign/filament-locksmith","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"80a94fb8cfb5b2bd02e8a964d289208a8bb08c85"},"previous_names":["discoverydesign/filament-locksmith"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/discoverydesign/filament-locksmith","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverydesign%2Ffilament-locksmith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverydesign%2Ffilament-locksmith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverydesign%2Ffilament-locksmith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverydesign%2Ffilament-locksmith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discoverydesign","download_url":"https://codeload.github.com/discoverydesign/filament-locksmith/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverydesign%2Ffilament-locksmith/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30236046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["filament-plugin","filamentadmin","filamentphp","filamentphp-plugin","laravel","livewire"],"created_at":"2024-09-24T19:49:23.333Z","updated_at":"2026-03-07T23:02:21.753Z","avatar_url":"https://github.com/discoverydesign.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filament Locksmith\n\n🔒 Passwords inputs made easy in Filament PHP 🤫\n\n![Basic Example](https://raw.githubusercontent.com/discoverydesign/filament-locksmith/main/media/2.png)\n\n![Packagist Version](https://img.shields.io/packagist/v/discoverydesign/filament-locksmith.svg)\n![Total Downloads](https://img.shields.io/packagist/dt/discoverydesign/filament-locksmith.svg)\n\nThis package allows you to add a feature rich password input/field for Filament PHP.\n\nhttps://packagist.org/packages/discoverydesign/filament-locksmith\n\n```\ncomposer require discoverydesign/filament-locksmith\n```\n\n## Features\n- Ability to copy password\n- Ability to automatically generate passwords. Default to 32 random character string. \n- User-friendly preset generator, creates 3 word combo passwords. E.g: `elephant-plant-photo`.\n- Automatically hash password when storing to database. Useful when a cast can't be used.\n- Block password field being editable, forcing a randomly generated password.\n\n## How to use\n1. Install the package using `composer require discoverydesign/filament-locksmith`\n2. Import the package inside your Filament Form with `use DiscoveryDesign\\FilamentLocksmith\\Forms\\Components\\PasswordInput`.\n3. Add the `PasswordInput` form component to your form with `PasswordInput::make()`.\n4. If required, publish the translation files with `php artisan vendor:publish --tag=filament-locksmith-translations`.\n\n## Examples\n\n### Basic Example\n```php\n\u003c?php\n\nnamespace App\\Filament\\Resources;\n\nuse DiscoveryDesign\\FilamentLocksmith\\Forms\\Components\\PasswordInput;\n// ...\n\nclass UserResource extends Resource\n{\n    // ...\n\n    public static function form(Form $form): Form\n    {\n        return $form\n            -\u003eschema([\n                PasswordInput::make('password')\n                    -\u003erequired()\n                    -\u003egeneratable()\n                    -\u003efriendly()\n                    -\u003ecopyable()\n                    -\u003erevealable(),\n                    \n                // ...\n            ]);\n    }\n    \n    // ...\n}\n```\n\n### Advanced Example\n```php\nPasswordInput::make('password')\n    -\u003erequired()\n    -\u003eadvanced()\n    -\u003ecopyable()\n    -\u003erevealable(),\n```\n\n### Custom Generators Example\n```php\nPasswordInput::make('password')\n    -\u003erequired()\n    -\u003eadvanced()\n    -\u003esetGenerators([\n        new DiscoveryDesign\\FilamentLocksmith\\Generators\\RandomGenerator,\n        new DiscoveryDesign\\FilamentLocksmith\\Generators\\MemorableGenerator\n    ])\n    -\u003ecopyable()\n    -\u003erevealable(),\n```\n\n### Only Required on Create\n```php\nPasswordInput::make('password')\n    -\u003erequired(fn($record) =\u003e !$record) // Only required if no record\n    -\u003eadvanced()\n    -\u003ecopyable()\n    -\u003erevealable(),\n```\n\n\n## Docs\n\n### `-\u003egeneratable($state)`\n\n#### Description\n`generatable` can be used to set if this password field should allow for an automatic password to be generated. This by default will generate a 32 character random string.\n\n#### Arguments\n`state` - (optional, bool) If the password should be generatable.\n\n### `-\u003efriendly()`\n\n#### Description\n`friendly` is a preloaded generator that creates a user friendly password. This password consists of 3 words that are combinred with '-'. E.g `time-shelf-bottle`\n\n### `-\u003ecopyable($state)`\n\n#### Description\n`copyable` can be used to set if this password field should copyable to clipboard.\n\n#### Arguments\n`state` - (optional, bool) If the password should be copyable.\n\n### `-\u003eeditable($state)`\n\n#### Description\n`editable` can be used to block the password field being edited. This is normally combined with `-\u003egeneratable()`.\n\n#### Arguments\n`state` - (optional, bool) If the password should be editable.\n\n### `-\u003egenerator($func)`\n\n#### Description\n`generator` allows you to define a custom generator that is used to create a password.\n\n#### Arguments\n`func` - (optional, closure | bool) The function used to generate the password. This function **must** return a string.\n\n### `-\u003ehashed($state)`\n\n#### Description\n`hashed` can be used if the password should be hashed before being stored. **In most cases, you should instead use a cast against your model.**\n\n#### Arguments\n`state` - (optional, bool) If the password should be hashed.\n\n### `-\u003erevealable($func)`\n\n#### Description\n`revealable` can be used to allow the password to be revealed. This is just Filament's built in reveal functionality.\n\n#### Arguments\n`func` - (optional, closure | bool) If the password should be revealable. If a closure is passed, this should return a bool.\n\n### `-\u003eadvanced()`\n\n#### Description\n`advanced` will enable advanced mode which allows user configuration of their password, along with a selection of different password types.\n\n#### Arguments\n`state` - (optional, bool) If the password should be hashed.\n\n### `-\u003eaddGenerator($generator)`\n\n#### Description\n`addGenerator` can be used to add a generator to the advance mode password generator. You should pass in an instance of a class that extends `DiscoveryDesign\\FilamentLocksmith\\Generators\\BaseGenerator`.\n\n#### Arguments\n`generator` - (class, extends BaseGenerator) The generator to add.\n\n### `-\u003esetGenerators($generators)`\n\n#### Description\n`setGenerators` will override all existing generators assigned to this PasswordInput and instead use the ones passed in. You should pass in an array of instances of a class that extends `DiscoveryDesign\\FilamentLocksmith\\Generators\\BaseGenerator`.\n\n#### Arguments\n`generators` - (array) The generators to set.\n\n### `-\u003egetGenerators()`\n\n#### Description\n`getGenerators` can be used to get an array of all the current generators.\n\n\n## Creating a generator\n\nIf you want to create a generator, you should first start by creating a new class that extends `DiscoveryDesign\\FilamentLocksmith\\Generators\\BaseGenerator`.\n\nInside your `__construct` you should include any options that you want to use to generate the password. It is encouraged to use a unique name for your form inputs.\n\nThe `generate` function should return a string that is the password.\n\n```php\n\u003c?php\n\nnamespace App\\Filament\\Locksmith\\Generators;\n\nuse Filament\\Forms;\nuse DiscoveryDesign\\FilamentLocksmith\\Generators\\BaseGenerator;\nuse Illuminate\\Support\\Str;\n\nclass MyCustomGenerator extends BaseGenerator\n{\n    public string $name = 'My Custom Generator';\n\n    public function __construct()\n    {\n\n        $this-\u003esetOptions([\n            Forms\\Components\\TextInput::make('mygenerator_length')\n                -\u003elabel('length')\n                -\u003edefault(20)\n                -\u003etype('number')\n                -\u003erequired()\n        ]);\n    }\n\n    public function generate($get)\n    {\n        $length = $get('mygenerator_length');\n\n        return Str::password($length);\n    }\n}\n```\n\nYou can then add this generator to your password input with `-\u003eaddGenerator(new MyCustomGenerator)`.\n\n## Author\n\n🚀 [Discovery Design](https://discoverydesign.co.uk)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscoverydesign%2Ffilament-locksmith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscoverydesign%2Ffilament-locksmith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscoverydesign%2Ffilament-locksmith/lists"}