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


PHP ResponseFactory::make方法代码示例

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


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

示例1: make

 /**
  * Make the response.
  *
  * @param FileInterface $file
  * @return Response
  */
 public function make(FileInterface $file)
 {
     // Start the response.
     $response = $this->response->make();
     $response->headers->set('Etag', $file->etag());
     $response->headers->set('Content-Type', $file->getMimetype());
     $response->headers->set('Last-Modified', $file->lastModified()->setTimezone('GMT')->format('D, d M Y H:i:s'));
     $response->setTtl(3600);
     return $response;
 }
开发者ID:ramcda,项目名称:files-module,代码行数:16,代码来源:FileResponse.php

示例2: make

 /**
  * Make the response.
  *
  * @param FileInterface $file
  * @return Response
  */
 public function make(FileInterface $file)
 {
     // Start the response.
     $response = $this->response->make();
     $response->headers->set('Pragma', 'public');
     $response->headers->set('Etag', $file->hash());
     $response->headers->set('Content-Length', $file->getSize());
     $response->headers->set('Content-Type', $file->getMimetype());
     $response->headers->set('Cache-Control', 'public,max-age=300,s-maxage=900');
     // Should be configurable
     $response->headers->set('Last-Modified', $file->lastModified()->setTimezone('GMT')->format('D, d M Y H:i:s'));
     return $response;
 }
开发者ID:bloveless,项目名称:files-module,代码行数:19,代码来源:FileResponse.php

示例3: 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

示例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: make

 /**
  * Return a new response from the application.
  *
  * @param string $content
  * @param int $status
  * @param array $headers
  * @return \Illuminate\Http\Response 
  * @static 
  */
 public static function make($content = '', $status = 200, $headers = array())
 {
     return \Illuminate\Routing\ResponseFactory::make($content, $status, $headers);
 }
开发者ID:satriashp,项目名称:tour,代码行数:13,代码来源:_ide_helper.php


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