$page_number, 'perPage' => 8, 'params' => ["class" => "table table-bordered", "border" => "2"], 'baseUrl' => "/admin/menu", ])); $table->columns([ 'parent_id' => (function ($data) { if ($data == 0) return null; return Menu::find($data)->label; }), '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->beforePrint(function () { return PrimaryBtn::create("Создать", "/admin/menu/create")->fetch(); //return (new PrimaryBtn("Создать", "/admin/user/create"))->fetch(); }); $table->addAction(MenuViewActionColumn::class); $table->addAction(MenuEditActionColumn::class); $table->addAction(MenuDeleteActionColumn::class); $table->create(); $table->render();