当前位置: 首页>>代码示例>>PHP>>正文


PHP Profile::where方法代码示例

本文整理汇总了PHP中app\models\Profile::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::where方法的具体用法?PHP Profile::where怎么用?PHP Profile::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Profile的用法示例。


在下文中一共展示了Profile::where方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Profile $childprofile)
 {
     if (!empty($parentId = Auth::user()->parent_user)) {
         $this->profiles = $childprofile->where('parent_id', '=', $parentId)->orWhere('parent_id', '=', Auth::user()->id)->get();
     } else {
         $this->profiles = $childprofile->where('parent_id', '=', Auth::user()->id)->get();
     }
     return view('profile.index', array('profile' => $this->profiles, 'image_path' => $this->imagePath));
 }
开发者ID:bradsmithcan,项目名称:laravel_infusionsoft_constantcontact,代码行数:14,代码来源:ProfileController.php

示例2: findByUserId

 public function findByUserId($userId)
 {
     $profile = Profile::where('user_id', $userId)->first();
     if ($profile) {
         return $profile;
     } else {
         $this->throwStoreResourceFailedException();
     }
 }
开发者ID:muhammadshakeel,项目名称:laravel-api-boilerplate-oauth,代码行数:9,代码来源:ProfileRepository.php

示例3: index

 public function index()
 {
     //$user = User::find(11);
     //Auth::login($user);
     $formData = Auth::user();
     $id = Auth::user()->id;
     $profile = Profile::where("user_id", '=', $id)->first();
     $view_data = ['title' => "My Profile", 'user' => $formData, 'profileData' => $profile];
     return view('profile/myprofile', $view_data);
 }
开发者ID:algobasket,项目名称:eve-online-project,代码行数:10,代码来源:ProfileController.php

示例4: update

 /**
  * Update user profile
  *
  * @POST("profile/{id}/update", as="profile.update")
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function update(Request $request)
 {
     $user = User::where('id', $request->input('id'))->first();
     $user->fill($request->all());
     $user->update();
     $profile = Profile::where('user_id', $request->input('id'))->first();
     $profile->fill($request->all());
     $profile->user()->associate($user);
     $profile->update();
     return redirect('/profile');
 }
开发者ID:lyovkin,项目名称:elcoinbank,代码行数:18,代码来源:ProfileController.php

示例5: index

 public function index()
 {
     $profiles = ProfileModel::where('name', 'andi')->get();
     return view('profile', ['name' => $profiles]);
 }
开发者ID:christopherstock,项目名称:laravel-workshop1,代码行数:5,代码来源:Profile.php

示例6: isFirstLogin

 public function isFirstLogin($email)
 {
     $user = $this->loadUser($email);
     $profile = Profile::where('user_id', '=', $user->id)->first();
     return is_null($profile);
 }
开发者ID:juliardi,项目名称:jualjasa,代码行数:6,代码来源:LoginServiceImpl.php

示例7: compose

 public function compose(View $view)
 {
     $data = Profile::where('user_id', Auth::user()->id)->first();
     $view->with('data', $data);
 }
开发者ID:lyovkin,项目名称:elcoinbank,代码行数:5,代码来源:ProfileComposer.php

示例8: complete

 /**
  * Update profile of newly registered user
  *
  * @param  Request  $request
  * @return Response
  */
 public function complete(Request $request)
 {
     //$user = User::find(1);
     //Auth::login($user);
     if ($request->isMethod('post')) {
         $formData = $request->all();
         $user = Auth::user();
         $id = Auth::user()->id;
         $profile = Profile::where("user_id", '=', $id)->first();
         if ($profile['origin'] == "vk" && empty($user->vk_email)) {
             $rules = array('email' => 'required|max:50|unique:users,email,' . $id, 'name' => 'required|max:50');
             $user->vk_email = $request->get('email');
         } else {
             $rules = array('name' => 'required|max:50');
         }
         $validator = Validator::make($formData, $rules);
         if ($validator->fails()) {
             return Redirect::to('/login/complete')->withInput()->withErrors($validator);
         }
         // $formData['email'] = Auth::user()->email;
         // need server side validation before it goes to db
         $user->name = trim($request->get('name'));
         $user->save();
         $eve_api_key = $request->get('eve_api_key');
         $eve_user_id = $request->get('eve_user_id');
         $i = 0;
         foreach ($eve_user_id as $key => $value) {
             $Apikey = new Apikey();
             if (empty($value) || empty($eve_api_key[$key])) {
                 continue;
             }
             $row_id = Apikey::where('apikey', $value)->where("uid", "=", $user->id)->first();
             if (!empty($row_id)) {
                 $row = $row_id;
             } else {
                 $row = $Apikey;
             }
             $row->uid = $user->id;
             $row->apikey = $value;
             $row->vkey = $eve_api_key[$key];
             //$row->save();
             $i++;
         }
         /*if($i==0){			
         			Session::flash('error_message', 'Username or password is incorrect'); 
         			return redirect("/login/complete") ;
         		}else{
         			Session::flash('error_message', 'Username or password is incorrect'); 
         		}*/
         return redirect('/')->withMessage("Profile Updated");
     }
     $formData = Auth::user();
     $id = $formData->id;
     $api_keys = User::find($id)->apikeys;
     $profile = Profile::where("user_id", '=', $id)->first();
     $view_data = ['title' => "Complete your profile", 'form_data' => $formData, 'apikey' => $api_keys, 'profileData' => $profile];
     return view('login/complete', $view_data);
 }
开发者ID:algobasket,项目名称:eve-online-project,代码行数:64,代码来源:AuthController.php


注:本文中的app\models\Profile::where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。