PHP code example of bezhansalleh / filament-addons

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

    

bezhansalleh / filament-addons example snippets


use BezhanSalleh\FilamentAddons\Forms\Components;

        Components\Pills::make('Heading')
            ->activePill(2) // pill two will be the default active one
            ->pills([
                Components\Pills\Pill::make('Shield')
                    ->icon('heroicon-o-shield-check')
                    ->badge('7.2K')
                    ->schema([
                        Forms\Components\View::make('static-hello')
                    ]),
                Components\Pills\Pill::make('Google Analytics')
                    ->schema([
                        Forms\Components\View::make('static-why')
                            ->fieldWrapperView(fn() => view('welcome')),
                        ])->columns(1),
                Components\Pills\Pill::make('Translations Manager')
                    ->icon('heroicon-o-sparkles')
                    ->schema([
                        Forms\Components\View::make('static-view'),
                        ...
                    ]),
                ]),

use BezhanSalleh\FilamentAddons\Tables\Columns\ChipColumn;

ChipColumn::make('role')
    ->label('Role(Chip)')
    ->colors([
        'primary',
        'success' => fn ($state): bool => $state === 'admin',
        'warning' => fn ($state): bool => $state === 'manager',
        'danger' => fn ($state): bool => $state === 'editor',
    ])
    ->icons([
        'heroicon-o-x',
        'heroicon-s-shield-check' => fn ($state): bool => $state === 'admin',
        'heroicon-o-user' => fn ($state): bool => $state === 'manager',
        'heroicon-o-sparkles' => fn ($state): bool => $state === 'editor'
    ])
    ->iconPosition('before')
bash
php artisan vendor:publish --tag="filament-addons-views"