Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed Oct 18, 2023
1 parent c9e34cf commit acbf330
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
[![PHP from Packagist](https://img.shields.io/packagist/php-v/rawilk/filament-password-input?style=flat-square)](https://packagist.org/packages/rawilk/filament-password-input)
[![License](https://img.shields.io/github/license/rawilk/filament-password-input?style=flat-square)](https://github.com/rawilk/filament-password-input/blob/main/LICENSE.md)

##
![social image](https://banners.beyondco.de/Filament%20Password%20Input.png?theme=light&packageManager=composer+require&packageName=rawilk%2Ffilament-password-input&pattern=architect&style=style_1&description=Enhanced+password+input+component+for+filament.&md=1&showWatermark=0&fontSize=100px&images=lock-closed)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
`filament-password-input` is a package built for [Filament](https://filamentphp.com) that provides an enhanced password input form component that offers you the ability to add the following
features to your password inputs:

- Reveal password toggle
- Copy to clipboard
- Generate new password button

## Installation

Expand All @@ -18,27 +23,32 @@ You can install the package via composer:
composer require rawilk/filament-password-input
```

You can publish and run the migrations with:
That's it. There is no configuration file or migrations necessary for the package.

```bash
php artisan vendor:publish --tag="filament-password-input-migrations"
php artisan migrate
```
## Usage

You can publish the config file with:
Inside a form schema, you can use the `Password` input like this:

```bash
php artisan vendor:publish --tag="filament-password-input-config"
```php
use Rawilk\FilamentPasswordInput\Password;
use Filament\Forms\Form;

public function form(Form $form): Form
{
return $form
->schema([
// ...
Password::make('password')
->label('Password'),
]);
}
```

You can view the default configuration here: https://github.com/rawilk/filament-password-input/blob/main/config/filament-password-input.php
The code above will render a password input inside the form with a toggle button to show and hide the password.

## Usage
![base input](docs/images/base-input.png)

```php
$filament-password-input = new Rawilk\FilamentPasswordInput;
echo $filament-password-input->echoPhrase('Hello, Rawilk!');
```
![base input unmasked](docs/images/base-input-unmasked.png)

## Scripts

Expand All @@ -50,6 +60,10 @@ For convenience, you can run the setup bin script for easy installation for loca
./bin/setup.sh
```

### Build

Any time changes are made to the blade file, the `./bin/build.sh` script should be run so our css can be recompiled.

### Formatting

Although formatting is done automatically via workflow, you can format php code locally before committing with a composer script:
Expand Down
Binary file added docs/images/base-input-unmasked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/base-input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit acbf330

Please sign in to comment.