当前位置: 首页>>代码示例>>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;未经允许,请勿转载。