當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。