MicroFrameWork/views/admin/user/view.php

22 lines
776 B
PHP
Raw Normal View History

2024-07-25 11:55:31 +03:00
<?php
/**
* @var \Illuminate\Database\Eloquent\Collection $user
*/
use Itguild\Tables\ViewJsonTable;
use kernel\IGTabel\btn\PrimaryBtn;
use kernel\IGTabel\ViewJsonTableEloquentModel;
$dataProvider = new ViewJsonTableEloquentModel($user, [
'params' => ["class" => "table table-bordered", "border" => "2"],
'baseUrl' => "/admin/user",
]);
$table = new ViewJsonTable($dataProvider->getJson());
$table->beforeTable(function () use ($user) {
$btn = PrimaryBtn::create("Список", "/admin/user")->fetch();
$btn .= PrimaryBtn::create("Редактировать", "/admin/user/update/" . $user->id)->fetch();
$btn .= PrimaryBtn::create("Удалить", "/admin/user/delete/" . $user->id)->fetch();
return $btn;
});
$table->create();
$table->render();