{"id":15019863,"url":"https://github.com/oooholdings/nova-password-generator","last_synced_at":"2025-10-24T18:30:17.256Z","repository":{"id":39611440,"uuid":"479938523","full_name":"oooholdings/nova-password-generator","owner":"oooholdings","description":"Random Password Generation Field for Laravel Nova","archived":false,"fork":false,"pushed_at":"2023-02-03T23:41:50.000Z","size":859,"stargazers_count":11,"open_issues_count":5,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T03:33:09.339Z","etag":null,"topics":["field","laravel","nova","nova-field","password-generator"],"latest_commit_sha":null,"homepage":"","language":"Vue","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/oooholdings.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-10T06:57:51.000Z","updated_at":"2024-11-30T09:51:50.000Z","dependencies_parsed_at":"2023-02-18T12:16:23.800Z","dependency_job_id":null,"html_url":"https://github.com/oooholdings/nova-password-generator","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oooholdings%2Fnova-password-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oooholdings%2Fnova-password-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oooholdings%2Fnova-password-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oooholdings%2Fnova-password-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oooholdings","download_url":"https://codeload.github.com/oooholdings/nova-password-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238016137,"owners_count":19402514,"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":["field","laravel","nova","nova-field","password-generator"],"created_at":"2024-09-24T19:54:12.713Z","updated_at":"2025-10-24T18:30:16.666Z","avatar_url":"https://github.com/oooholdings.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Password Generator Field for Laravel Nova](banner.jpg)\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Total Downloads][ico-downloads]][link-downloads]\n[![License][ico-license]][link-license]\n[![Laravel Nova v4][ico-nova-v4]][link-nova-v4]\n\n---\n\n1. [Introduction](#introduction)\n2. [Installation](#installation)\n    1. [Localization](#localization)\n3. [Usage](#usage)\n    1. [Password Length](#password-length)\n    2. [Prefix and Suffixes](#prefix-and-suffixes)\n    3. [Hide Toolbar Elements](#hide-toolbar-elements)\n    4. [Customize Password Generation](#customize-password-generation)\n    5. [Operation Based Filling](#operation-based-filling)\n    6. [Index and Detail View](#index-and-detail-view)\n    7. [Other Methods](#other-methods)\n4. [Credits](#credits)\n    1. [Localizations](#localizations)\n5. [License](#license)\n\n---\n\n## Introduction\n\nPassword Generator is a custom field for Laravel Nova (v4), allowing you to add a password generator when creating or\nupdating resources.\n\n![Password Generator Field Preview](preview.jpg)\n\nCurrently, you can show and hide the password. Include or exclude uppercase, lowercase, numbers and symbols from the\ngenerated passwords. Change the password length, minimum and maximum length or total length that respects the length of\nany prefix or suffix used on in the password. Easily copy it to your clipboard and regenerate passwords when you update\nthe options or manually via the button.\n\nBelow you will find some more information about the [usage](#usage) of this field.\n\n## Installation\n\nInstall this package via composer:\n\n``` bash\n$ composer require outofoffice/password-generator\n```\n\n### Localization\n\nPublish the package language files to your application's `resources/lang/vendor` directory:\n\n```\nphp artisan vendor:publish --provider=\"OutOfOffice\\PasswordGenerator\\FieldServiceProvider\"\n```\n\nIf you would like to help contribute to this package, localizing the package into a language you know would be a huge\nhelp!\n\n## Usage\n\nYou can use the `PasswordGenerator` field just like the built-in `Password` field, within your Nova Resources.\n\n```php\n// in app/Nova/[Resource].php\n\nuse OutOfOffice\\PasswordGenerator\\PasswordGenerator;\n\npublic function fields()\n{\n    return [\n\n        PasswordGenerator::make( 'Password' )\n            -\u003eonlyOnForms()\n            -\u003ecreationRules( 'required', Rules\\Password::defaults() )\n            -\u003eupdateRules( 'nullable', Rules\\Password::defaults() ),\n\n    ];\n}\n```\n\nThere are plenty of optional chain-methods you could add to change the functionality and visuals of the field itself.\n\nBelow will show the methods defaults, they're only used when added to the method chain. So some defaults will not\nreflect the actual field defaults when no meta is passed to it. For example, using `fillOnCreate()`\nwill have a default of true when using the method, but this is not enabled by default within the actual default field\noptions itself. Unless otherwise stated, with phrases like `Enabled/Disabled by default` or\n`Included/Excluded by default` These methods are meant to allow you to set your own defaults.\n\n### Password Length\n\nYou can determine the password length, be it generally, totally or the minimum and maximum lengths.\n\n```php\n// in app/Nova/[Resource].php\n\nuse OutOfOffice\\PasswordGenerator\\PasswordGenerator;\n\npublic function fields()\n{\n    return [\n\n        PasswordGenerator::make( 'Password' )\n            // Password length, not respecting prefix or suffix length\n            -\u003elength( int $length = 16 )\n            // Overrides general length, respects prefix or suffix length\n            -\u003etotalLength( int $length = 24 )\n            // Generated passwords will be minimum of this value\n            -\u003eminLength( int $minLength = 8 )\n            // Generated passwords will be maximum of this value\n            -\u003emaxLength( int $maxLength = 128 )\n            // Length should increment by this value when changing length via field\n            -\u003elengthIncrementSteps( int $lengthSteps = 4 ),\n\n    ];\n}\n```\n\n### Prefix and Suffixes\n\nWant to customize the password a bit? You can use the `prefix()` and/or `suffix()` methods to add a custom string to the\nbeginning or end of a password. If you use the `totalLength()` method as well you will ensure the length of the password\nrespects your prefix and/or suffix.\n\n```php\n// in app/Nova/[Resource].php\n\nuse OutOfOffice\\PasswordGenerator\\PasswordGenerator;\n\npublic function fields()\n{\n    return [\n\n        PasswordGenerator::make( 'Password' )\n            // Generated passwords will start with this value (e.g. 'ooo.jX90')\n            -\u003eprefix( 'ooo.' ) // default: ''\n            // Generated passwords will end with this value (e.g. 'jX90.ooo')\n            -\u003esuffix( '.ooo' ), // default: ''\n\n    ];\n}\n```\n\n### Hide Toolbar Elements\n\nSometimes you may think the option toolbar is too long or is overkill for your app. You can easily decide to hide any or\nall of the toolbar elements, as well as keep some functionality with other methods listed below.\n\n```php\n// in app/Nova/[Resource].php\n\nuse OutOfOffice\\PasswordGenerator\\PasswordGenerator;\n\npublic function fields()\n{\n    return [\n\n        PasswordGenerator::make( 'Password' )\n            // Hide all toolbar elements, or combo this method with other\n            // methods to display only one or two elements\n            -\u003ehideAllExtras( bool $hide = true )\n            // Hide the show password button from the toolbar, or don't\n            -\u003ehideShowPasswordToggle( bool $hide = true )\n            // Hide the password generation options from the toolbar, or don't\n            -\u003ehideOptionsToggles( bool $hide = true )\n            // Hide the password length input from the toolbar, or don't\n            -\u003ehideLengthInput( bool $hide = true )\n            // Hide the copy password button from the toolbar, or don't\n            -\u003ehideCopyPasswordButton( bool $hide = true )\n            // Hide the refresh/regenerate password button from the toolbar, or don't\n            -\u003ehideRegenerateButton( bool $hide = true ),\n\n    ];\n}\n```\n\n### Customize Password Generation\n\nDepending on your requirements, you might need to include or exclude specific characters from the final charlist used to\ngenerate passwords. Use the following methods to accomplish that.\n\n```php\n// in app/Nova/[Resource].php\n\nuse OutOfOffice\\PasswordGenerator\\PasswordGenerator;\n\npublic function fields()\n{\n    return [\n\n        PasswordGenerator::make( 'Password' )\n            // Included by default, you can exclude all uppercase characters (e.g. ABC)\n            -\u003eexcludeUppercase( bool $exclude = true )\n            // Included by default, you can exclude all lowercase characters (e.g. abc)\n            -\u003eexcludeLowercase( bool $exclude = true )\n            // Included by default, you can exclude all numbers characters (e.g. 123)\n            -\u003eexcludeNumbers( bool $exclude = true )\n            // Included by default, you can exclude all symbols characters (e.g. $@!)\n            -\u003eexcludeSymbols( bool $exclude = true )\n            // Excluded by default, you can exclude characters that may look similar\n            // (e.g. \"i, l, 1, L, o, 0, O\")\n            -\u003eexcludeSimilar( bool $exclude = true )\n            // Excluded by default, you can exclude ambiguous symbols\n            // (e.g. \"{ } [ ] ( ) / \\ ' \" ` ~ , ; : . \u003c \u003e\")\n            -\u003eexcludeAmbiguous( bool $exclude = true )\n            // One method to exclude multiple options, accepts the following:\n            // 'uppercase' or 'upper', 'lowercase' or 'lower', 'numbers' or 'digits',\n            // 'symbols' or 'special', 'similar', 'ambiguous'\n            -\u003eexcludeRules( array $excludeRules )\n            // Customize the character list for the generated password, just pass\n            // a string to this method, check PasswordGenerator class for more charlists\n            // using this method auto-hides the option element from the toolbar\n            -\u003ecustomCharlist( string $charlist = PasswordGenerator::BASE16_MOD ),\n\n    ];\n}\n```\n\n### Operation Based Filling\n\nSometimes you may want to autofill the password when the page is loaded, but usually you don't want to update the\npasswords when you're editing a resource. But we still have methods for both use-cases.\n\n```php\n// in app/Nova/[Resource].php\n\nuse OutOfOffice\\PasswordGenerator\\PasswordGenerator;\n\npublic function fields()\n{\n    return [\n\n        PasswordGenerator::make( 'Password' )\n            // Disabled by default, will fill input with generated password on load\n            // only when creating a new resource.\n            -\u003efillOnCreate( bool $enabled = true )\n            // Disabled by default, will fill input with generated password on load\n            // only when updating a new resource.\n            -\u003efillOnUpdate( bool $enabled = true ),\n\n    ];\n}\n```\n\n### Index and Detail View\n\nYou can now show the value of your field on the index or detail pages, usually you wouldn't want to do this if you're\nusing this field for passwords. But with other use-cases like tokens and such, this would be great. Since there's a\ndetail field now, you can use this within the resource preview modal.\n\n```php\n// in app/Nova/[Resource].php\n\nuse OutOfOffice\\PasswordGenerator\\PasswordGenerator;\n\npublic function fields()\n{\n    return [\n\n        PasswordGenerator::make( 'Personal Access Token' )\n            // Show the password as plain-text by default on the respective pages\n            // These three methods work well with the others as they just show the field value\n            // on page load, you can use the other methods below for the styling\n            -\u003eshowValueOnDetail( bool $show = true )\n            -\u003eshowValueOnIndex( bool $show = true )\n            -\u003eshowValueOnUpdate( bool $show = true )\n            // Hide the password with a blur effect on the respective pages\n            -\u003eblurValueOnDetail( bool $show = true )\n            -\u003eblurValueOnIndex( bool $show = true )\n            // Hide the password with a set character on the respective pages\n            -\u003eredactValueOnDetail( bool $redact = true, string $character = '•' )\n            -\u003eredactValueOnIndex( bool $redact = true, string $character = '•' )\n\n    ];\n}\n```\n\n### Other Methods\n\nJust a list of other miscellaneous methods to control smaller features.\n\n```php\n// in app/Nova/[Resource].php\n\nuse OutOfOffice\\PasswordGenerator\\PasswordGenerator;\n\npublic function fields()\n{\n    return [\n\n        PasswordGenerator::make( 'Password' )\n            // Show the password as plain-text in the password field by default\n            -\u003eshowPassword( bool $show = true )\n            // Should the password be regenerated when an option is changed\n            -\u003eregenerateOnToggle( bool $enabled = true )\n            // Should the toolbar be placed above the password field\n            -\u003etoolbarOnTop( bool $toolbarOnTop = true )\n            // Disable the side toolbar, only displaying it above or below the password field\n            -\u003edisableSideToolbar( bool $disable = true )\n            // Disable hashing the field value while saving to the database\n            // Always hash your users passwords! This is for other non-sensitive use-cases\n            -\u003esaveAsPlainText( bool $plainText = true ),\n\n    ];\n}\n```\n\n## Credits\n\n- [Out of Office][link-company]\n- [Miguel Batres][link-author]\n- [Package Banner][link-beyondcode-banners] by BeyondCode\n\n### Localizations:\n\n- [@wamesro](https://github.com/wamesro)\n  provided [Slovak](https://github.com/oooholdings/nova-password-generator/pull/17)\n\n## License\n\nMIT - Please see the [license file](license.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/outofoffice/password-generator.svg?style=flat-square\n\n[ico-downloads]: https://img.shields.io/packagist/dt/outofoffice/password-generator.svg?style=flat-square\n\n[ico-license]: https://img.shields.io/packagist/l/outofoffice/password-generator?style=flat-square\n\n[ico-nova-v4]: https://img.shields.io/badge/nova-v4-333?logo=laravel-nova\u0026style=flat-square\n\n[link-packagist]: https://packagist.org/packages/outofoffice/password-generator\n\n[link-downloads]: https://packagist.org/packages/outofoffice/password-generator\n\n[link-author]: https://github.com/btrsco\n\n[link-company]: https://github.com/oooholdings\n\n[link-license]: https://github.com/oooholdings/nova-password-generator/blob/master/license.md\n\n[link-nova-v4]: https://nova.laravel.com/docs/4.0/\n\n[link-contributors]: https://github.com/oooholdings/nova-password-generator/contributors\n\n[link-beyondcode-banners]: https://banners.beyondco.de/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foooholdings%2Fnova-password-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foooholdings%2Fnova-password-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foooholdings%2Fnova-password-generator/lists"}