PHP code example of webwizardsusa / filament-table-layouts

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

    

webwizardsusa / filament-table-layouts example snippets


use Webwizardsusa\TableLayouts\Card;

public static function table(Table $table): Table
{
    return $table
        ->columns([
            ImageColumn::make('cover'),
            TextColumn::make('title')->searchable()->sortable(),
            TextColumn::make('author.name'),
        ])
        ->card(
            Card::make([
                TextColumn::make('title')->weight(FontWeight::Bold),
                TextColumn::make('author.name')->color('gray'),
            ])->image('cover'),
        );
}

use Webwizardsusa\TableLayouts\Enums\TableLayout;

$table->card($card)->defaultLayout(TableLayout::Card);
$table->card($card)->availableLayouts(TableLayout::Card);