PHP code example of programmingwormhole / filapayer

1. Go to this page and download the library: Download programmingwormhole/filapayer 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/ */

    

programmingwormhole / filapayer example snippets


use FilaPayer\FilamentTheme\FilaPayerThemePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->id('admin')
        ->path('admin')
        ->plugin(FilaPayerThemePlugin::make())
        // ... your resources, pages and widgets
        ;
}

->plugin(FilaPayerThemePlugin::make())
->colors(['primary' => Color::Emerald])   // this wins — intentional or not

// config/filapayer.php  (abridged)
'brand'    => ['name' => …, 'tagline' => …, 'logo' => ['mark' => …]],
'colors'   => ['primary' => '#007AFF', 'accent' => '#F59E0B'],
'sidebar'  => ['width' => '16rem'],
'auth'     => ['headline' => …, 'subheadline' => …, 'points' => [['icon' => …, 'text' => …]]],
'currency' => ['default' => 'USD', 'supported' => ['USD', 'EUR', 'GBP']],
'support'  => ['email' => …, 'phone' => …, 'hours' => …],

FilaPayerThemePlugin::make()
    ->brandName('Acme Pay')
    ->brandLogo('brand.mark')
    ->primaryColor('#0F62FE')
    ->settingsPage(\App\Filament\Pages\Settings::class)
    ->accountMenuItems([
        ['label' => 'Profile',  'icon' => 'heroicon-o-user',     'url' => route('filament.admin.pages.settings')],
        ['label' => 'Security', 'icon' => 'heroicon-o-lock-closed', 'url' => route('filament.admin.pages.settings').'#security'],
    ])

use FilaPayer\FilamentTheme\Support\Money;

Money::fromMinor(1234567, 'USD')->format();        // "$12,345.67"
Money::fromMinor(-4200)->formatSigned();           // "-$42.00"
Money::fromMinor(1234567)->formatCompact();        // "$12k"  — below 10k keeps a decimal: "$1.4k"
Money::fromMajor('99.99', 'EUR')->plus($other);    // immutable arithmetic
Money::zero()->isZero();                           // true

use FilaPayer\FilamentTheme\Support\Masking;

Masking::cardNumber('2143');            // "•••• •••• •••• 2143"
Masking::lastFour('2143');              // "•••• 2143"
Masking::account('Chase', '8891');      // "Chase •••• 8891"
Masking::email('[email protected]');   // "al••••@acme.com"
Masking::phone('+1 555 0199');          // "••• ••• 0199"

use Filament\Support\Facades\FilamentView;
use Filament\View\PanelsRenderHook;

FilamentView::registerRenderHook(PanelsRenderHook::HEAD_END, fn (): string => <<<'HTML'
    <style>
        :root {
            --fp-sidebar-bg: #101828;
            --fp-canvas: #f7f8fa;
            --fp-brand: #0f62fe;
        }
    </style>
HTML);

   ->plugin(FilaPayerThemePlugin::make()->theme(false))
   ->theme(Vite::asset('resources/css/vendor/filapayer/theme.css'))
   
bash
php artisan vendor:publish --tag=filapayer-config
bash
php artisan vendor:publish --tag=filapayer-css
bash
php artisan vendor:publish --tag=filapayer-css   # → resources/css/vendor/filapayer/theme.css