Skip to content

Commit bb5227f

Browse files
committed
Update readme
1 parent 1e3e7cc commit bb5227f

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,45 @@ composer require rappasoft/laravel-livewire-tables
1919

2020
## Usage
2121

22-
[See the documentation](https://github.com/rappasoft/laravel-livewire-tables/wiki)
22+
### [Read the documentation](https://github.com/rappasoft/laravel-livewire-tables/wiki)
23+
24+
## Basic Example
25+
26+
```php
27+
<?php
28+
29+
namespace App\Http\Livewire\Admin\User;
30+
31+
use App\Domains\Auth\Models\User;
32+
use Illuminate\Database\Eloquent\Builder;
33+
use Rappasoft\LaravelLivewireTables\DataTableComponent;
34+
use Rappasoft\LaravelLivewireTables\Views\Column;
35+
36+
class UsersTable extends DataTableComponent
37+
{
38+
39+
public function columns(): array
40+
{
41+
return [
42+
Column::make('Name')
43+
->sortable()
44+
->searchable(),
45+
Column::make('E-mail', 'email')
46+
->sortable()
47+
->searchable(),
48+
Column::make('Verified', 'email_verified_at')
49+
->sortable(),
50+
];
51+
}
52+
53+
public function query(): Builder
54+
{
55+
return User::query();
56+
}
57+
}
58+
```
59+
60+
### [See advanced example](https://github.com/rappasoft/laravel-livewire-tables/wiki/Advanced-Example-Table)
2361

2462
## To-do/Roadmap
2563

0 commit comments

Comments
 (0)