Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,25 @@ use Simtabi\Laranail\Confetti\Facades\Confetti;
Confetti::realistic()->shoot();
```

## Quick start
## Quick start guide and usage

### Getting started

1. Put the runtime on your pages, once. Use the `<x-laranail-confetti::scripts />` component shown in Install, or let the middleware append it to every HTML response:

```dotenv
CONFETTI_AUTO_INJECT=true
```

2. Check the setup. It reports the bundle, the asset delivery mode and any Content-Security-Policy directives you need:

```bash
php artisan laranail::confetti.doctor
```

3. Optionally, `php artisan laranail::confetti.install` writes `config/laranail/confetti.php`; every setting has a working default.

### Usage

```php
use Simtabi\Laranail\Confetti\Facades\Confetti;
Expand All @@ -46,6 +64,15 @@ public function store(StoreOrderRequest $request)
}
```

Several bursts at once, with shared options said once:

```php
Confetti::colors('#bb0000', '#ffffff')
->left()->count(100)->then()
->right()->count(100)
->shoot();
```

The full walkthrough is in [Getting started](docs/getting-started.md); everything else is in the [documentation index](#documentation).

## <a name="documentation"></a>Documentation
Expand Down
Loading