add ListEloquentTable

This commit is contained in:
2024-08-06 16:13:19 +03:00
parent 1316f68469
commit 22898f4c07
3 changed files with 86 additions and 5 deletions

View File

@ -34,14 +34,29 @@ $capsule->bootEloquent();
$schema = $capsule->schema();
$dataProvider = new EloquentDataProvider(\Itguild\EloquentTable\models\User::class, [
//$dataProvider = new EloquentDataProvider(\Itguild\EloquentTable\models\User::class, [
// 'currentPage' => 1,
// 'perPage' => 3,
// 'params' => ["class" => "table table-bordered", "border" => "2"],
// 'baseUrl' => "/admin/user",
//]);
//$table = new ListJsonTable($dataProvider->getJson());
//
//$table->addAction(\Itguild\Tables\ActionColumn\EditActionColumn::class);
//$table->create();
//$table->render();
$table = new \Itguild\EloquentTable\ListEloquentTable([
'model' => \Itguild\EloquentTable\models\User::class,
'currentPage' => 1,
'perPage' => 3,
'params' => ["class" => "table table-bordered", "border" => "2"],
'baseUrl' => "/admin/user",
'actions' => [
\Itguild\Tables\ActionColumn\ViewActionColumn::class,
\Itguild\Tables\ActionColumn\EditActionColumn::class
]
]);
$table = new ListJsonTable($dataProvider->getJson());
$table->addAction(\Itguild\Tables\ActionColumn\EditActionColumn::class);
$table->create();
$table->render();