PHP code example of zonvoir / laravel-inertia-table
1. Go to this page and download the library: Download zonvoir/laravel-inertia-table 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/ */
zonvoir / laravel-inertia-table example snippets
use App\Models\User;
use Zonvoir\InertiaTable\Columns\TextColumn;
use Zonvoir\InertiaTable\Table;
use Zonvoir\InertiaTable\TableState;
class UsersTable extends Table
{
protected ?string $resource = User::class;
public function columns(): array
{
return [
TextColumn::make('name')
->label('Name')
->sortable(),
TextColumn::create('email', 'Email Address')
->searchable(),
];
}
}
use Zonvoir\InertiaTable\Enums\PaginationType;
use Zonvoir\InertiaTable\Table;
class UsersTable extends Table
{
protected PaginationType $paginationType = PaginationType::Simple;
protected ?array $perPageOptions = [15, 30, 50, 100];
protected ?int $defaultPerPage = 50;
}