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


PHP Auth::customer方法代碼示例

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


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

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Auth::customer()->check()) {
         return redirect()->intended('customer/dashboard');
     }
     return $next($request);
 }
開發者ID:BryceHappy,項目名稱:lavender,代碼行數:14,代碼來源:RedirectIfAuthenticated.php

示例2: forgot_password

 public function forgot_password(Form $form)
 {
     $request = $form->request->all();
     if (!Auth::customer()->forgotPassword($request['email'])) {
         $error = trans('account.alerts.wrong_password_forgot');
         Message::addError($error);
         throw new \Exception($error);
     }
     Message::addSuccess(trans('account.alerts.password_forgot'));
 }
開發者ID:BryceHappy,項目名稱:lavender,代碼行數:10,代碼來源:AuthHandler.php

示例3: header

 protected function header()
 {
     $top_links = menu('header.links');
     $top_links->add('cart', ['href' => url('cart'), 'text' => 'Cart #' . $this->cart->id . ' - ' . $this->cart->getSummary() . ' item(s)']);
     if (Auth::customer()->check()) {
         $top_links->add('account', ['href' => url('customer/dashboard'), 'text' => 'My Account']);
         $top_links->add('logout', ['href' => url('customer/logout'), 'text' => 'Logout']);
     } else {
         $top_links->add('login', ['href' => url('customer/login'), 'text' => 'Login/Register']);
     }
 }
開發者ID:BryceHappy,項目名稱:lavender,代碼行數:11,代碼來源:FrontendHandler.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Auth::customer()->guest()) {
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             return redirect()->guest('customer/login');
         }
     }
     return $next($request);
 }
開發者ID:BryceHappy,項目名稱:lavender,代碼行數:18,代碼來源:Authenticate.php

示例5: __construct

 /**
  * Create a new authentication controller instance.
  */
 public function __construct()
 {
     $this->auth = Auth::customer();
     $this->middleware('guest', ['except' => 'getLogout']);
     $this->loadLayout();
 }
開發者ID:BryceHappy,項目名稱:lavender,代碼行數:9,代碼來源:AuthController.php

示例6: __construct

 /**
  * Create a new authentication controller instance.
  */
 public function __construct()
 {
     $this->auth = Auth::customer();
     $this->middleware('auth');
     $this->loadLayout();
 }
開發者ID:BryceHappy,項目名稱:lavender,代碼行數:9,代碼來源:DashboardController.php


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