File tree Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,45 @@ composer require rappasoft/laravel-livewire-tables
19
19
20
20
## Usage
21
21
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 )
23
61
24
62
## To-do/Roadmap
25
63
You can’t perform that action at this time.
0 commit comments