Examples
List view examples
Error!
Success!
belal ddx
daadadakk
hello
2132tytyiu
cdcsdc
keykha asfd
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
daadadakk
hello
2132tytyiu
cdcsdc
keykha asfd
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
daadadakk
Change user as admin
Change user as writer
Activate / Deactivate
hello
2132tytyiu
Change user as admin
Change user as writer
Activate / Deactivate
cdcsdc
keykha asfd
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
daadadakk
Change user as admin
Change user as writer
Activate / Deactivate
hello
2132tytyiu
Change user as admin
Change user as writer
Activate / Deactivate
cdcsdc
keykha asfd
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
hello
Writer
Change user as admin
Change user as writer
Activate / Deactivate
cdcsdc
Writer
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
Writer
Change user as admin
Change user as writer
Activate / Deactivate
sdsd
Writer
Change user as admin
Change user as writer
Activate / Deactivate
tesdasda
Writer
Change user as admin
Change user as writer
Activate / Deactivate
Bande de iok
Writer
Change user as admin
Change user as writer
Activate / Deactivate
Brycen Schade
Writer
Change user as admin
Change user as writer
Activate / Deactivate
Mrs. Kassandra Stiedemann
Writer
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()
];
}
}