post crud fix

This commit is contained in:
2024-07-26 12:42:44 +03:00
parent f5f546ba95
commit 2d8f945cad
7 changed files with 25 additions and 8 deletions

View File

@ -18,13 +18,14 @@ $dataProvider = new ListJsonTableEloquentCollection($contents, [
'params' => ["class" => "table table-bordered", "border" => "2"],
'baseUrl' => "/admin/post",
]);
$table = new ListJsonTable($dataProvider->getJson());
$table->beforePrint(function (){
return PrimaryBtn::create("Создать", "/admin/post/create")->fetch();
//return (new PrimaryBtn("Создать", "/admin/user/create"))->fetch();
});
$table->addAction(UserViewActionColumn::class);
$table->addAction(UserEditActionColumn::class);
$table->addAction(\app\tables\columns\PostEditActionColumn::class);
$table->addAction(UserDeleteActionColumn::class);
$table->create();
$table->render();