/** * Fetch countries from database * * @param bool * * @return Illuminate\Database\Eloquent\Collection (of Country) */ protected function getCountries($withTrashed) { $countries = Country::select('id', 'iso_3166_2', 'name')->orderBy('name'); if ($withTrashed) { $countries->withTrashed(); } return $countries->get(); }
public function countries() { return Country::select("id", "name")->lists("name", "id"); }
public static function getAll() { $countries = Country::select('code', 'name')->get(); return $countries; }
public static function getCountry() { $arr_country = Country::select('name', 'id')->get()->toArray(); return $arr_country; }
/** * Display a listing of the resource. * * @return Response */ public function index() { $countries = Country::select('id', 'name', 'full_name', 'capital', 'currency', 'currency_symbol')->orderBy('name')->get(); return View('admin.countries', ['countries' => $countries]); }