Download the PHP package rawilk/filament-password-input without Composer

On this page you can find all versions of the php package rawilk/filament-password-input. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-password-input

filament-password-input

Latest Version on Packagist Tests Total Downloads PHP from Packagist License

social image

filament-password-input is a package built for Filament that provides an enhanced password input form component that offers you the ability to add the following features to your password inputs:

Installation

Upgrading to 2.0 from 1.x? Be sure to follow the Upgrade guide for breaking changes.

You can install the package via composer:

That's it. There is no configuration file or migrations necessary for the package. Any customization is done directly on the input itself, or globally in a service provider, however there are a few language lines that can be overridden if necessary in your application. You may publish the language files with:

Usage

Inside a form schema, you can use the Password input like this:

The code above will render a password input inside the form with a toggle button to show and hide the password.

base input

If you want to render a normal password input without the toggle, you may also do that with this field. The following code will render the password input without the toggle button inside it:

Copy to Clipboard

You can easily make any password input copyable by calling the copyable() method on the input. This will merge an action button in with any other suffixActions you have defined on the input.

copyable input

Note: This button will not show up if the input is disabled.

If you'd like the copy button to show up as an inline suffix instead, you can simply call the inlineSuffix() method on the input.

Icon Color

You can customize the color of the icon by passing in a color to the copyable method:

Title/Label

When you hover over the copy button, a title saying Copy to clipboard will show up. You can customize this text globally by overriding the filament-password-input::password.actions.copy.tooltip language key.

Confirmation Text

Once clicked, a tooltip will appear with the text Copied. You can customize this text globally by overriding the filament::components/copyable.messages.copied language key, or individually by using the copyMessage method:

Copy Message Duration

The confirmation text that appears after clicking the copy button will disappear after 1 second by default. You can customize this with the copyMessageDuration method:

Note: The duration should be in milliseconds, and as an integer value.

Password Generation

Another feature offered by this component is password generation. By calling the regeneratePassword() method on the input, a button will be merged in with any other suffixActions you have defined on the input.

regenerate password

Note: This button will not show up if the input is disabled or readonly.

As with the copy to clipboard action button, you can have this action rendered inline on the input as well by calling the inlineSuffix() method on the input.

Password Generation Method

By default, the password generation is handled with Laravel's Str::password() helper method. This will generate a random, strong password that is 32 characters long for you. If you have a maxLength() set on the input, that length will be used instead for the character length.

You may also use a completely custom generation method by providing a closure to the regeneratePassword method:

Now when the button is clicked, my-custom-password will be filled into the input instead. Like with most callbacks in filament, you are able to inject filament's utilities into the callback as well.

Password Max Length

When using the default password generator (Str::password()), we will tell it to use the maxLength() that is set on the input. This means that if you set a maximum length of 10 characters, the password generated by this action will be 10 characters long. By default, it is 32 characters long if a max length is not set.

Note: Due to how Laravel's Str::password() helper works, the password max length must be a minimum of 3 characters long.

If you want to use a different length than the input's max length, you can also use the newPasswordLength method as well:

Icon Color

You can customize the color of the icon by passing a color to the regeneratePassword method:

Title/Label

When you hover the generate password action button, the text Generate new password will show up. You can customize this text globally by overriding the filament-password-input::password.actions.regenerate.tooltip language key.

Confirmation Message

Once a new password is generated and returned to the UI, the component will make use of a filament Notification with the text New password was generated!. You can customize this globally by overriding the filament-password-input::password.actions.regenerate.success_message language key.

You may also disable this notification all-together by providing a false value to the regeneratePassword method:

Password Managers

If you have a password manager installed, like 1Password or LastPass, you'll know that they automatically inject a button into password inputs. Normally, this is a good thing, but there can be times when this is not desired, such as in local development or on a form where you're inputting something other than your own password.

To disable password managers from injecting themselves into your password inputs, you may use the hidePasswordManagerIcons() method:

This will add data-1p-ignore and data-lpignore="true" attributes to the input to attempt to block password managers from injecting their buttons. This isn't always 100% effective, but it should work in most cases. If you know of a better way to handle this, PR's are always welcome.

Icons

The icons for used in the actions on this component can be customized in a service provider by registering their aliases with filament.

Here are the aliases required to modify each icon:

Kitchen Sink Example

Here is an example of an input with all the actions enabled:

kitchen sink

Global Configuration

Like most things in filament, you can customize a lot of the default behavior of this input in a service provider using configureUsing:

Any behavior defined here can still be overridden on individual inputs as needed.

Scripts

Setup

For convenience, you can run the setup bin script for easy installation for local development.

Formatting

Although formatting is done automatically via workflow, you can format php code locally before committing with a composer script:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

Please review my security policy on how to report security vulnerabilities.

Credits

Alternatives

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-password-input with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
filament/forms Version ^3.2
illuminate/contracts Version ^10.0|^11.0
spatie/laravel-package-tools Version ^1.14
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rawilk/filament-password-input contains the following files

Loading the files please wait ....