Use datatable in laravel 8 <?php /* =====In Controller file===== */ use DataTables; public function ajax_get_blogs(Request $request) { if ($request->ajax()) { $data = Blog::select('*'); return Datatables::of($data) ->addIndexColumn() ->addColumn('featured_image', function($row){ if($row->featured_image == ''){ $featured_image = asset("upload/image-not-found.jpg"); } else { $featured_image = asset("upload/" . $row->featured_image); } $featured_image_view = '<img src="'. $featured_image .'">'; ...
We provide knowledgeable blogs related to php, jQuery, html, css, wordpress, woocommerce, cordova app with examples in 2021.