當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Confide::user方法代碼示例

本文整理匯總了PHP中Confide::user方法的典型用法代碼示例。如果您正苦於以下問題:PHP Confide::user方法的具體用法?PHP Confide::user怎麽用?PHP Confide::user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Confide的用法示例。


在下文中一共展示了Confide::user方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: home

 /**
  * @return $this
  */
 public function home()
 {
     if (Confide::User()) {
         $this->dsp->content = Confide::user()->getContent();
     }
     return View::make('dispatch')->with(['dsp' => $this->dsp]);
 }
開發者ID:birdiebel,項目名稱:G2016,代碼行數:10,代碼來源:HomeController.php

示例2: update

 /**
  * Update the specified pet in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $pet = Pet::findOrFail($id);
     $data = Input::all();
     $data['user_id'] = Confide::user()->id;
     $validator = Validator::make($data, Pet::$rules);
     $response = [];
     $response['data'] = $data;
     if ($validator->fails()) {
         $response['success'] = false;
         $response['errors'] = $validator->errors();
         if (Request::ajax()) {
             return Response::json($response);
         } else {
             return Redirect::back()->withErrors($validator->errors());
         }
     }
     $pet->update($data);
     $response['success'] = true;
     $response['errors'] = [];
     if (Request::ajax()) {
         return Response::json($response);
     } else {
         return Redirect::action('UsersController@showProfile', Confide::user()->id);
     }
 }
開發者ID:ZJScapstone,項目名稱:capstone.dev,代碼行數:32,代碼來源:PetsController.php

示例3: login

 /**
  * Displays the login form
  *
  * @return  Illuminate\Http\Response
  */
 public function login()
 {
     if (Confide::user()) {
         return Redirect::to('/');
     } else {
         return View::make(Config::get('confide::login_form'));
     }
 }
開發者ID:matalina,項目名稱:kids-pledge,代碼行數:13,代碼來源:UsersController.php

示例4: login

 /**
  * Displays the login form
  *
  * @return  Illuminate\Http\Response
  */
 public function login()
 {
     if (Confide::user()) {
         return Redirect::to('/home');
     } else {
         return View::make('site.user.login');
     }
 }
開發者ID:carlosqueiroz,項目名稱:medical-management-system,代碼行數:13,代碼來源:UsersController.php

示例5: isExist

 /**
  * @param $club_id
  * @return bool
  */
 public static function isExist($club_id)
 {
     $count = DB::table('userclubs')->where('user_id', '=', Confide::user()->id)->where('club_id', '=', $club_id)->count();
     if ($count == 0) {
         return false;
     }
     return true;
 }
開發者ID:birdiebel,項目名稱:G2016,代碼行數:12,代碼來源:Userclub.php

示例6: login

 /**
  * Displays the login form
  *
  * @return  Illuminate\Http\Response
  */
 public function login()
 {
     if (Confide::user()) {
         return Redirect::route('backend.challenges.index');
     } else {
         return View::make(Config::get('confide::login_form'));
     }
 }
開發者ID:arghyapolley,項目名稱:backend,代碼行數:13,代碼來源:UsersController.php

示例7: validateRoles

 /**
  * Provide an array of strings that map to valid roles.
  * @param array $roles
  * @return stdClass
  */
 public function validateRoles(array $roles)
 {
     $user = Confide::user();
     $roleValidation = new stdClass();
     foreach ($roles as $role) {
         $roleValidation->{$role} = empty($user) ? false : $user->hasRole($role);
     }
     return $roleValidation;
 }
開發者ID:ntk148v,項目名稱:mini_cms,代碼行數:14,代碼來源:Role.php

示例8: getIndex

 public function getIndex()
 {
     $user = Confide::user();
     if (!$user->isStaff() && Patient::find($user->id) == null) {
         return Redirect::route('patient.create');
     } else {
         return View::make('home/index', compact('user'));
     }
 }
開發者ID:carlosqueiroz,項目名稱:medical-management-system,代碼行數:9,代碼來源:HomeController.php

示例9: login

 /**
  * Displays the login form
  *
  * @return  Illuminate\Http\Response
  */
 public function login()
 {
     SEOMeta::setTitle(Lang::get("tags.login"));
     if (Confide::user()) {
         return Redirect::to('/');
     } else {
         return View::make(Config::get('confide::login_form'));
     }
 }
開發者ID:kadirarli,項目名稱:laravel-self,代碼行數:14,代碼來源:UsersController.php

示例10: login

 /**
  * Displays the login form
  *
  * @return  Illuminate\Http\Response
  */
 public function login()
 {
     if (Confide::user()) {
         return Redirect::to('/');
     } else {
         $title = 'League Together - Login';
         return View::make('app.default.login')->with('page_title', $title);
         //return View::make(Config::get('confide::login_form'));
     }
 }
開發者ID:illuminate3,項目名稱:league-production,代碼行數:15,代碼來源:UsersController.php

示例11: uploadUserImage

 public function uploadUserImage()
 {
     $user = Confide::user();
     $user->img_path = $this->getAndMoveFile('file');
     if ($user->save()) {
         return Redirect::action('UsersController@show', $user->id);
     } else {
         throw new Exception("user image not updated!");
     }
 }
開發者ID:ZJScapstone,項目名稱:capstone.dev,代碼行數:10,代碼來源:ImagesController.php

示例12: login

 /**
  * Displays the login form
  *
  */
 public function login()
 {
     if (\Confide::user()) {
         // If user is logged, redirect to internal
         // page, change it to '/admin', '/dashboard' or something
         return Redirect::to('/');
     } else {
         $this->renderPage(array("content_view" => Config::get('confide::login_form')));
     }
 }
開發者ID:ayurved,項目名稱:Ayurveda,代碼行數:14,代碼來源:AuthController.php

示例13: showAll

 public function showAll()
 {
     $user = Confide::user();
     $patients = Patient::join('user', 'user.id', '=', 'patient.user_id')->get();
     if ($user->isStaff()) {
         return View::make('home.patient.show-all', compact('user', 'patients'));
     } else {
         return Redirect::route('home.index');
     }
 }
開發者ID:carlosqueiroz,項目名稱:medical-management-system,代碼行數:10,代碼來源:PatientController.php

示例14: createComment

 public function createComment($conversation)
 {
     $user = Confide::user();
     $comment = new Comment();
     $comment->conversation_id = $conversation->id;
     $comment->user_id = $user->id;
     $comment->fill(Input::all());
     $comment->save();
     return Redirect::route('conversation.show', array($conversation->id));
 }
開發者ID:carlosqueiroz,項目名稱:medical-management-system,代碼行數:10,代碼來源:ConversationController.php

示例15: logAudit

 public static function logAudit($entity, $action, $description)
 {
     $audit = new Audit();
     $audit->date = date('Y-m-d');
     $audit->description = $description;
     $audit->user = Confide::user()->username;
     $audit->entity = $entity;
     $audit->action = $action;
     $audit->save();
 }
開發者ID:kenkode,項目名稱:xaraerp,代碼行數:10,代碼來源:Audit.php


注:本文中的Confide::user方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。