pages = factory(Page::class, 2)->make(); $this->pages = Page::get(); } public function get() { $test = Datatables::of($this->pages) ->escapeColumns(['title']) ->addColumn('status', function ($page) { return $page->status; }) ->addColumn('created_at', function ($page) { return $page->created_at->toDateString(); }) ->addColumn('created_by', function ($page) { return $page->created_by; }) ->addColumn('actions', function ($page) { return $page->action_buttons; }) ->make(true); return $test; } }