public function getDatatable() { $news = Charters::leftJoin('lokasis', 'charters.lokasi', '=', 'lokasis.id')->leftJoin('categories', 'charters.categories', '=', 'categories.id')->select(array('charters.id', 'charters.image', 'charters.name', 'lokasis.name as lokasi', 'categories.name as categories', 'charters.price', 'charters.headline')); return Datatables::of($news)->addColumn('image', function ($news) { return '<img src="../' . $news->image . '"class="img-responsive" width="200" height="200"></img>'; })->addColumn('action', function ($news) { return '<a href="charters/edit/' . $news->id . '" class="btn btn-xs btn-primary">Edit</a> <a href="charters/delete/' . $news->id . '" class="btn btn-xs btn-danger">Delete</a>'; })->removeColumn('created_at', 'update_at')->make(true); }