laranail/confetti is not published to Packagist, so there is no registry-version badge to show: see Install.
A fluent confetti builder for Laravel: canvas-confetti wrapped in a typed, validated PHP API, with Blade, Livewire, Inertia and Filament adapters.
PHP ^8.4.1 on Laravel ^13.
composer require laranail/confettiThe service provider is auto-discovered. Add the runtime to your layout, once,
before </body>:
<x-laranail-confetti::scripts />Then fire it from anywhere:
use Simtabi\Laranail\Confetti\Facades\Confetti;
Confetti::realistic()->shoot();-
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:CONFETTI_AUTO_INJECT=true
-
Check the setup. It reports the bundle, the asset delivery mode and any Content-Security-Policy directives you need:
php artisan laranail::confetti.doctor
-
Optionally,
php artisan laranail::confetti.installwritesconfig/laranail/confetti.php; every setting has a working default.
use Simtabi\Laranail\Confetti\Facades\Confetti;
public function store(StoreOrderRequest $request)
{
$order = $this->placeOrder->handle($request->toData());
Confetti::realistic()->shoot();
return redirect()->route('orders.show', $order);
}Several bursts at once, with shared options said once:
Confetti::colors('#bb0000', '#ffffff')
->left()->count(100)->then()
->right()->count(100)
->shoot();The full walkthrough is in Getting started; everything else is in the documentation index.
Full documentation is at opensource.simtabi.com/documentation/laranail/confetti covering installation and the three ways to get the runtime onto a page, the builder and every canvas-confetti option, the nine presets, named effects, hooks and events, the client-side animation engine, asset delivery, transports, validation, testing, the Artisan commands, and recipes for Blade, Livewire, Inertia, Filament, custom shapes, custom presets, Content-Security-Policy and reduced motion.
Questions and ideas belong in Discussions; reproducible faults in Issues.
See CONTRIBUTING.md and SECURITY.md. Report
vulnerabilities privately to opensource@simtabi.com.
Particle rendering is canvas-confetti by Kiril Vatev (ISC), bundled with the package.
MIT © Simtabi LLC. See LICENSE; the embedded canvas-confetti is ISC, see attribution.md.