PHP code example of alexsyvolap / filament-confetti

1. Go to this page and download the library: Download alexsyvolap/filament-confetti library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alexsyvolap / filament-confetti example snippets


use AlexSyvolap\FilamentConfetti\FilamentConfettiPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(FilamentConfettiPlugin::make());
}

use AlexSyvolap\FilamentConfetti\Confetti;

Confetti::shoot();

Confetti::left()->shoot();
Confetti::topRight()->shoot();
Confetti::bottom()->shoot();

// Realistic 3D explosion with 5 physical waves
Confetti::realistic()->shoot();

// 15 seconds of falling snow
Confetti::snow()->shoot();

// 15 seconds of random fireworks in the sky
Confetti::fireworks()->shoot();

// Raining Emoji explosion!
Confetti::emoji('💸')->shoot();

// School Pride (fires from both bottom corners)
Confetti::colors(['#0057B7', '#FFDD00'])->schoolPride()->shoot();

Confetti::left()->count(150)
    ->then()
    ->right()->count(150)
    ->shoot();

Confetti::center()
    ->count(300)
    ->spread(120)
    ->shapes(['star', 'circle'])
    ->colors(['#ff0000', '#00ff00', '#0000ff'])
    ->startVelocity(100)
    ->decay(0.8) // High friction (stops quickly in the air)
    ->gravity(0.5)
    ->flat(true) // 2D flat paper effect
    ->shoot();

$confetti = Confetti::make();

for ($delay = 0; $delay < 3000; $delay += 500) {
    $confetti->center()->count(50)->delay($delay)->then();
}

$confetti->shoot();