コード例 #1
0
ファイル: UsersController.php プロジェクト: Nataliia-IG/adsk
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit()
 {
     $User = Auth::user();
     $this->data['User'] = $User;
     $this->data['Countries'] = Country::orderBy('title')->get();
     return view('client.users.edit', $this->data);
 }
コード例 #2
0
 public function getCountry()
 {
     try {
         $response = [];
         $statusCode = 200;
         $country = Country::orderBy('country_name', 'ASC')->get();
         foreach ($country as $c) {
             $response[] = ['id' => $c->id, 'country_name' => $c->country_name];
         }
     } catch (Exception $e) {
         $statusCode = 404;
     } finally {
         return Response::json($response, $statusCode);
     }
 }