Examples
List view examples
Error!
Success!
belal ddx
mmk dd
test
2132tytyiuaaaaa
cdcsdc
keykha asfd2
Just for testt adsf
test
test123
dwadwad
sdsd
test@test.test
tesdasda
javonte.kutch@example.comxfz
Bande de iok
qcollier@example.uk
Brycen Schade
celestinoprenner@example.net
Mrs. Kassandra Stiedemann
griffin.aufderha00r@example.net
<?php
namespace App\Http\Livewire\ListView;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use LaravelViews\Views\ListView;
class UsersListView extends ListView
{
public $paginate = 10;
/**
* Sets a initial query with the data to fill the table
*
* @return Builder Eloquent query
*/
public function repository(): Builder
{
return User::query();
}
/**
* Sets the properties to every list item component
*
* @param $model Current model for each card
*/
public function data($model)
{
return [
'avatar' => asset('storage/' . $model->avatar),
'title' => $model->name,
'subtitle' => $model->email,
];
}
}
Error!
Success!
belal ddx
mmk dd
test
2132tytyiuaaaaa
cdcsdc
keykha asfd2
Just for testt adsf
test
test123
dwadwad
sdsd
test@test.test
tesdasda
javonte.kutch@example.comxfz
Bande de iok
qcollier@example.uk
Brycen Schade
celestinoprenner@example.net
Mrs. Kassandra Stiedemann
griffin.aufderha00r@example.net
<?php
namespace App\Http\Livewire\ListView;
use App\Filters\UsersActiveFilter;
use App\Filters\UsersCreatedAtFilter;
use App\Filters\UsersTypeFilter;
class UsersWithFiltersListView extends UsersListView
{
public $searchBy = ['name', 'email'];
protected function filters()
{
return [
new UsersTypeFilter,
new UsersActiveFilter,
new UsersCreatedAtFilter
];
}
}
Error!
Success!
belal ddx
mmk dd
Change user as admin
Change user as writer
Activate / Deactivate
test
2132tytyiuaaaaa
Change user as admin
Change user as writer
Activate / Deactivate
cdcsdc
keykha asfd2
Change user as admin
Change user as writer
Activate / Deactivate
Just for testt adsf
test
Change user as admin
Change user as writer
Activate / Deactivate
test123
dwadwad
Change user as admin
Change user as writer
Activate / Deactivate
sdsd
test@test.test
Change user as admin
Change user as writer
Activate / Deactivate
tesdasda
javonte.kutch@example.comxfz
Change user as admin
Change user as writer
Activate / Deactivate
Bande de iok
qcollier@example.uk
Change user as admin
Change user as writer
Activate / Deactivate
Brycen Schade
celestinoprenner@example.net
Change user as admin
Change user as writer
Activate / Deactivate
Mrs. Kassandra Stiedemann
griffin.aufderha00r@example.net
Change user as admin
Change user as writer
Activate / Deactivate
<?php
namespace App\Http\Livewire\ListView;
use App\Actions\ChangeUserAsAdmin;
use App\Actions\ChangeUserAsWriter;
use App\Actions\ToggleUserAction;
class UsersWithActionsListView extends UsersWithFiltersListView
{
protected function actionsByRow()
{
return [
new ChangeUserAsAdmin,
new ChangeUserAsWriter,
new ToggleUserAction
];
}
}
Error!
Success!
belal ddx
mmk dd
Change user as admin
Change user as writer
Activate / Deactivate
test
2132tytyiuaaaaa
Change user as admin
Change user as writer
Activate / Deactivate
cdcsdc
keykha asfd2
Change user as admin
Change user as writer
Activate / Deactivate
Just for testt adsf
test
Change user as admin
Change user as writer
Activate / Deactivate
test123
dwadwad
Change user as admin
Change user as writer
Activate / Deactivate
sdsd
test@test.test
Change user as admin
Change user as writer
Activate / Deactivate
tesdasda
javonte.kutch@example.comxfz
Change user as admin
Change user as writer
Activate / Deactivate
Bande de iok
qcollier@example.uk
Change user as admin
Change user as writer
Activate / Deactivate
Brycen Schade
celestinoprenner@example.net
Change user as admin
Change user as writer
Activate / Deactivate
Mrs. Kassandra Stiedemann
griffin.aufderha00r@example.net
Change user as admin
Change user as writer
Activate / Deactivate
<?php
namespace App\Http\Livewire\ListView;
use App\Actions\Bulk\ChangeUsersAsAdmin;
use App\Actions\Bulk\ChangeUsersAsWriter;
class UsersWithBulkActionsListView extends UsersWithActionsListView
{
public function bulkActions()
{
return [
new ChangeUsersAsAdmin,
new ChangeUsersAsWriter,
];
}
}
Error!
Success!
belal ddx
Writer
Change user as admin
Change user as writer
Activate / Deactivate
test
Admin
Change user as admin
Change user as writer
Activate / Deactivate
cdcsdc
Admin
Change user as admin
Change user as writer
Activate / Deactivate
Just for testt adsf
Admin
Change user as admin
Change user as writer
Activate / Deactivate
test123
Admin
Change user as admin
Change user as writer
Activate / Deactivate
sdsd
Admin
Change user as admin
Change user as writer
Activate / Deactivate
tesdasda
Admin
Change user as admin
Change user as writer
Activate / Deactivate
Bande de iok
Admin
Change user as admin
Change user as writer
Activate / Deactivate
Brycen Schade
Admin
Change user as admin
Change user as writer
Activate / Deactivate
Mrs. Kassandra Stiedemann
Admin
Change user as admin
Change user as writer
Activate / Deactivate
<?php
namespace App\Http\Livewire\ListView;
use Carbon\Carbon;
class UsersWithCustomComponentListView extends UsersWithActionsListView
{
public $itemComponent = 'components.custom-list-item';
/**
* Sets the properties to every list item component
*
* @param $model Current model for each card
*/
public function data($model)
{
return [
'date' => Carbon::now()
];
}
}