Exemplo n.º 1
0
 /**
  * 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();
 }
Exemplo n.º 2
0
 public function countries()
 {
     return Country::select("id", "name")->lists("name", "id");
 }
Exemplo n.º 3
0
 public static function getAll()
 {
     $countries = Country::select('code', 'name')->get();
     return $countries;
 }
Exemplo n.º 4
0
 public static function getCountry()
 {
     $arr_country = Country::select('name', 'id')->get()->toArray();
     return $arr_country;
 }
Exemplo n.º 5
0
 /**
  * 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]);
 }