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


PHP Guard::check方法代码示例

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


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

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return redirect(env('REDIRECT_AUTHENTICATED', '/dashboard'));
     }
     return $next($request);
 }
开发者ID:maveius,项目名称:solvre,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例2: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return new RedirectResponse(route('after_login'));
     }
     return $next($request);
 }
开发者ID:Nataliia-IG,项目名称:adsk,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         //return redirect('/user/dashboard');
     }
     return $next($request);
 }
开发者ID:pcmquizon,项目名称:127-Overflow,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check() && !$request->user()->hasGroup('admin')) {
         return redirect('/');
     }
     return $next($request);
 }
开发者ID:jeremytubbs-deprecated,项目名称:L51-Start-Here,代码行数:14,代码来源:RedirectIfNotAdmin.php

示例5: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return \Redirect::back();
     }
     return $next($request);
 }
开发者ID:JFSolorzano,项目名称:Acordes,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例6: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->auth->check()) {
         return Redirect::route('frontpage');
     }
     return $next($request);
 }
开发者ID:malahierba-lab,项目名称:startup,代码行数:14,代码来源:RedirectIfNotAuthenticated.php

示例7: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure $next
  * @param int|string $role
  * @return mixed
  * @throws \FWM\Roles\Exceptions\RoleDeniedException
  */
 public function handle($request, Closure $next, $role)
 {
     if ($this->auth->check() && $this->auth->user()->is($role)) {
         return $next($request);
     }
     throw new RoleDeniedException($role);
 }
开发者ID:fastwebmedia,项目名称:laravel-roles,代码行数:16,代码来源:VerifyRole.php

示例8: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure $next
  * @param int|string $role
  * @return view
  */
 public function handle($request, Closure $next, $role)
 {
     if ($this->auth->check() && $this->auth->user()->is($role)) {
         return $next($request);
     }
     return $this->auth->check() ? view('lcp::auth.errors.role')->withError($role) : view('lcp::auth.login');
 }
开发者ID:askedio,项目名称:laravelcp,代码行数:15,代码来源:VerifyRole.php

示例9: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return redirect(\Config::get('portal.auth_login_home'));
     }
     return $next($request);
 }
开发者ID:grlf,项目名称:laravel-portal-template,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例10: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return Helpers::redirectDashboard();
     }
     return $next($request);
 }
开发者ID:darryldecode,项目名称:laravelbackend,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例11: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->auth->check()) {
         return redirect()->guest('auth/login');
     }
     return $next($request);
 }
开发者ID:Incubasys,项目名称:sql_query_help,代码行数:14,代码来源:Authenticate.php

示例12: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return redirect()->route('user.info', ['id' => $this->auth->id()]);
     }
     return $next($request);
 }
开发者ID:Colls,项目名称:meetings.laravel,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例13: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->auth->check() or !$this->auth->user()->canAccessAdminPanel()) {
         return redirect('/auth/login?ref=admin');
     }
     return $next($request);
 }
开发者ID:Orvo,项目名称:mlraamattu,代码行数:14,代码来源:AdminAuthenticate.php

示例14: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check() and $this->auth->user()->is('admin')) {
         return new RedirectResponse(route('home'));
     }
     return $next($request);
 }
开发者ID:straysh,项目名称:straysh.info,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure $next
  * @param int|string $permission
  * @return mixed
  * @throws \Bican\Roles\Exceptions\PermissionDeniedException
  */
 public function handle($request, Closure $next, $permission)
 {
     if ($this->auth->check() && $this->auth->user()->may($permission)) {
         return $next($request);
     }
     throw new PermissionDeniedException($permission);
 }
开发者ID:mcclainconcepts,项目名称:roles,代码行数:16,代码来源:VerifyPermission.php


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