ajax()) {
$data = Country::orderBy('id','desc');
return DataTables::of($data)
->addColumn('action', function ($row) {
$actionBtn = 'id) . '" class="edit btn btn-success btn-flat btn-sm"> ';
return $actionBtn;
})
->rawColumns(['action'])
->make(true);
}
}
/* Add Edit Country */
public static function addEditCountry($request, $id = '')
{
if ($id) {
$data = Country::find($id);
} else {
$data = new Country();
}
$data->name = $request->name;
$data->save();
return $data;
}
/* Delete Country */
public static function countrydelete($id)
{
Country::where('id', $id)->delete();
return 1;
}
/* Get Country List */
public static function get_CountryList()
{
return Country::all();
}
}