PHP code example of thiktak / filament-simple-list-entry

1. Go to this page and download the library: Download thiktak/filament-simple-list-entry 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/ */

    

thiktak / filament-simple-list-entry example snippets


// use Thiktak\FilamentSimpleListEntry\Infolists\Components\SimpleListEntry;

    public static function infolist(Infolist $infolist): Infolist
    {
        return $infolist
            ->schema([
                SimpleListEntry::make('users')
                    ->label('Default with Icon')
                    ->itemIcon('heroicon-o-check'),
            ]);
    }

SimpleListEntry::make('')
    ->label('Default with Icon')
    ->getStateUsing(['a', 'b', 'c'])
    ->itemIcon('heroicon-o-check'),

SimpleListEntry::make('')
    ->inline(true)
    ->label('Inline badge with icon & link')
    ->getStateUsing(['a', 'b', 'c'])
    ->itemIcon('heroicon-o-check')
    ->itemUrl(fn ($record) => '#' . $record)
    ->badge(true),

SimpleListEntry::make('')
    ->listStyle('inline')
    ->label('inline simple +')
    ->getStateUsing(['a', 'b', 'c'])
    ->separator(' + '),

SimpleListEntry::make('')
    ->listStyle('inline')
    ->label('inline with Icon')
    ->getStateUsing(['a', 'b', 'c'])
    ->itemIcon('heroicon-o-check'),

SimpleListEntry::make('scoresTop5')
    ->listStyle('list')
    ->itemLabel(fn ($record) => $record->item)
    ->itemUrl(fn ($record) => '#Url-' . $record->id)
    ->itemActions(
        fn ($record) => ActionGroup::make([
            Action::make('view'),
            Action::make('edit'),
            Action::make('delete'),
        ])
            ->size(ActionSize::Small)
    ),

SimpleListEntry::make('checklist')
    ->listStyle('list')
    ->getStateUsing([
        ['name' => 'Complete profile #1', 'score' => 1],
        ['name' => 'Complete profile #2', 'score' => .75]
    ])
    ->itemIcon(fn ($record) => match (true) {
        $record['score'] >= 1 => 'heroicon-o-check',
        default => 'heroicon-o-exclamation-triangle'
    })
    ->itemIconColor(fn ($record) => match (true) {
        $record['score'] >= 1 => 'success',
        default => 'danger'
    })
    ->itemActions(
        fn ($record) => [
            ViewAction::make('view1')
                    ->url('#View1-' . $record['name']),
            ActionGroup::make([
                Action::make('view2')
                    ->url('#View2-' . $record['name']),
                Action::make('edit'),
                Action::make('delete'),
            ])
                ->size(ActionSize::Small)
        ]
    )
    ->itemUrl(fn ($record) => '#Url-' . $record['name'])
    ->itemLabel(fn ($record) => $record['name'])
    ->itemDescription(function ($record) {
      return sprintf('Percentage: %s%%', $record['score'] * 100)
    }),