["class" => "table table-bordered", "border" => "2"], 'baseUrl' => "/admin/post", ])); $table->beforePrint(function () use ($content) { $btn = IconBtnListWidget::create(['url' => '/admin/post'])->run(); $btn .= IconBtnEditWidget::create(['url' => '/admin/post/update/' . $content->id])->run(); $btn .= IconBtnDeleteWidget::create(['url' => '/admin/post/delete/' . $content->id])->run(); return $btn; }); $table->rows([ '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"); }, 'user_id' => (function ($data) { return User::find($data)->username; }) ]); $table->create(); $table->render();