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


PHP Redirector::guest方法代码示例

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


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

示例1: handle

 /**
  * Run the request filter.
  *
  * @param Request  $request
  * @param \Closure $next
  * @param string   $context
  *
  * @return mixed
  */
 public function handle(Request $request, \Closure $next, $context)
 {
     list($context, $privacy) = $this->parseContext($context);
     $this->securityContext->bindContext($context, $request);
     try {
         $this->applySecurity($context, $privacy, $request);
         $response = $next($request);
     } catch (Unauthenticated $e) {
         $response = $this->redirector->guest($this->getLoginUrl($context));
     }
     $this->garbageCollect($this->securityContext->getSecurity($context), $this->securityContext->getConfigurationFor($context));
     return $response;
 }
开发者ID:digbang,项目名称:security,代码行数:22,代码来源:SecurityMiddleware.php

示例2: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     if ($this->guard->guest()) {
         if ($request->ajax()) {
             return $this->response->make('Unauthorized.', 401);
         } else {
             if ($request->segment(1) === 'admin') {
                 return $this->redirect->guest('admin/login');
             } else {
                 return $this->redirect->guest('login');
             }
         }
     }
     return $next($request);
 }
开发者ID:jacksun101,项目名称:users-module,代码行数:22,代码来源:Authenticate.php

示例3: unauthenticated

 /**
  * @param \Illuminate\Http\Request                 $request
  * @param \Illuminate\Auth\AuthenticationException $exception
  *
  * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
  */
 protected function unauthenticated($request, AuthenticationException $exception)
 {
     if ($request->expectsJson()) {
         return $this->response->json(['error' => 'Unauthenticated.'], 401);
     }
     return $this->redirector->guest('login');
 }
开发者ID:notadd,项目名称:framework,代码行数:13,代码来源:Handler.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     $response = $this->security->check($this->guard->user());
     if ($response instanceof Response) {
         return $response;
     }
     if ($this->guard->guest()) {
         if ($request->ajax()) {
             return $this->response->make('Unauthorized.', 401);
         } else {
             if ($request->segment(1) === 'admin') {
                 return $this->redirect->guest('admin/login');
             } else {
                 return $this->redirect->guest('login');
             }
         }
     }
     return $next($request);
 }
开发者ID:AkibaTech,项目名称:users-module,代码行数:26,代码来源:Authenticate.php

示例5: guest

 /**
  * Create a new redirect response, while putting the current URL in the session.
  *
  * @param string $path
  * @param int $status
  * @param array $headers
  * @param bool $secure
  * @return \Illuminate\Http\RedirectResponse 
  * @static 
  */
 public static function guest($path, $status = 302, $headers = array(), $secure = null)
 {
     return \Illuminate\Routing\Redirector::guest($path, $status, $headers, $secure);
 }
开发者ID:satriashp,项目名称:tour,代码行数:14,代码来源:_ide_helper.php

示例6: redirectGuest

 /**
  * Create a new redirect response, while putting the current URL in the session.
  *
  * @param  string  $path
  * @param  int     $status
  * @param  array   $headers
  * @param  bool    $secure
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function redirectGuest($path, $status = 302, $headers = array(), $secure = null)
 {
     return $this->redirector->guest($path, $status, $headers, $secure);
 }
开发者ID:visualturk,项目名称:framework,代码行数:13,代码来源:ResponseFactory.php


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