2025-01-13 15:52:38 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int $page_number
|
|
|
|
*/
|
|
|
|
|
|
|
|
use App\Models\User;
|
|
|
|
use Itguild\EloquentTable\EloquentDataProvider;
|
|
|
|
use Itguild\EloquentTable\ListEloquentTable;
|
|
|
|
|
|
|
|
$table = new ListEloquentTable(new EloquentDataProvider(User::class, [
|
|
|
|
'currentPage' => $page_number,
|
|
|
|
'perPage' => 3,
|
|
|
|
'params' => ["class" => "table table-bordered", "border" => "2"],
|
|
|
|
'baseUrl' => "/admin/user",
|
|
|
|
'searchPrefix' => "",
|
|
|
|
]));
|
|
|
|
|
|
|
|
$table->columns([
|
|
|
|
'user_photo' => function ($data) {
|
|
|
|
return $data ? "<img src='$data' width='150px'>" : "";
|
|
|
|
},
|
|
|
|
'created_at' => function ($data) {
|
|
|
|
if (!$data) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (new DateTimeImmutable($data))->format("d-m-Y");
|
|
|
|
},
|
|
|
|
'updated_at' => function ($data) {
|
|
|
|
if (!$data) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (new DateTimeImmutable($data))->format("d-m-Y");
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
$table->create();
|
2025-01-20 13:59:35 +03:00
|
|
|
//$table->render();
|
|
|
|
|
|
|
|
?>
|
|
|
|
<x-main>
|
|
|
|
<x-slot:title>
|
|
|
|
Custom Title
|
|
|
|
</x-slot>
|
|
|
|
|
|
|
|
@php
|
|
|
|
$table->render();
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
</x-main>
|
|
|
|
|