- Making Columns
- Built-in searching
- Built-in sorting
- Built-in cell formatting
- Conditional columns
- User column selection
- Secondary Header Functionality
- Footer Functionality
- Misc. Functionality
Getting Started
Usage
Columns
The Query
Row
Bulk Actions
Filters
Customizing
Display
🎉 Enjoying this package? Consider sponsoring me on GitHub or buying me a beer.
This is the documentation for v1 but the latest version is v3. You can switch versions in the menu on the left/at the top. Check your current version with the following command:
composer show rappasoft/laravel-livewire-tables
Basic Example
At the very least, you need to give the DataTable component a list of columns and a base query to start with:
For this basic example, the component will use the columns to generate the display as well, it will also use the columns sortable()
and searchable()
methods to add that functionality for you automatically.
1<?php 2 3namespace App\Http\Livewire\Admin\User; 4 5use App\Domains\Auth\Models\User; 6use Illuminate\Database\Eloquent\Builder; 7use Rappasoft\LaravelLivewireTables\DataTableComponent; 8use Rappasoft\LaravelLivewireTables\Views\Column; 9 10class UsersTable extends DataTableComponent11{12 13 public function columns(): array14 {15 return [16 Column::make('Name')17 ->sortable()18 ->searchable(),19 Column::make('E-mail', 'email')20 ->sortable()21 ->searchable(),22 Column::make('Verified', 'email_verified_at')23 ->sortable(),24 ];25 }26 27 public function query(): Builder28 {29 return User::query();30 }31}