本文整理汇总了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);
}
示例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'));
}
示例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']);
}
}
示例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);
}
示例5: __construct
/**
* Create a new authentication controller instance.
*/
public function __construct()
{
$this->auth = Auth::customer();
$this->middleware('guest', ['except' => 'getLogout']);
$this->loadLayout();
}
示例6: __construct
/**
* Create a new authentication controller instance.
*/
public function __construct()
{
$this->auth = Auth::customer();
$this->middleware('auth');
$this->loadLayout();
}