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


PHP Request::capture方法代码示例

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


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

示例1: onUserLogin

 public function onUserLogin($user, $remember)
 {
     $request = Request::capture();
     $user->last_login = Carbon::now();
     $user->ip_address = $request->ip();
     $user->save();
 }
开发者ID:rosemalejohn,项目名称:dnsc-hris,代码行数:7,代码来源:UserEventListener.php

示例2: run

 public function run()
 {
     $request = Request::capture();
     $config = $this->app->get("config");
     $action = $request->input($config->get('app.request_action'), '/');
     $responseContent = $this->runActionController($action);
     if (!$responseContent) {
         return;
     }
     $response = new Response($responseContent);
     $response->send();
     die;
 }
开发者ID:Whyounes,项目名称:WP-KAYO,代码行数:13,代码来源:ControllerHandler.php

示例3: update

 public function update($QuestionID)
 {
     if (!AuthController::checkPermission()) {
         return redirect('/');
     }
     $data = Request::capture();
     $count = $data['numAnswer'];
     // delete all old spaces with corresponding answers
     $oldSpaces = Spaces::where('QuestionID', '=', $QuestionID)->get()->toArray();
     foreach ($oldSpaces as $value) {
         SpacesController::destroy($value['id']);
     }
     for ($i = 0; $i < $count; $i++) {
         $rawAnswer = trim(AnswersController::c2s_convert($data['answer' . ($i + 1)]));
         preg_match_all('/([^;]+);/', $rawAnswer, $matches, PREG_PATTERN_ORDER);
         $arrayOfAnswer = $matches[1];
         $SpaceID = DB::table('spaces')->insertGetId(['QuestionID' => $QuestionID, 'created_at' => new \DateTime(), 'updated_at' => new \DateTime()]);
         $true = true;
         foreach ($arrayOfAnswer as $value) {
             $a = new Answers();
             $a->Logical = $true;
             $a->SpaceID = $SpaceID;
             $a->Detail = trim($value);
             $a->save();
             $true = false;
         }
     }
     return redirect(route('user.viewquestion', $QuestionID));
 }
开发者ID:ngocdon0127,项目名称:e-learning,代码行数:29,代码来源:SpacesController.php

示例4:

 function __construct($query, $id)
 {
     $this->query = $query;
     $this->id = $id;
     $this->Request = Request::capture();
     return $this;
 }
开发者ID:rafwell,项目名称:laravel-grid,代码行数:7,代码来源:Grid.php

示例5: saveAction

 public function saveAction()
 {
     $request = Request::capture();
     echo '<pre>';
     var_dump($request);
     die;
 }
开发者ID:scottwarren,项目名称:laravel-todo,代码行数:7,代码来源:TodoController.php

示例6: getFilters

 /**
  * Get Table Filter
  *
  * @author WN
  * @return Collection
  */
 protected function getFilters()
 {
     if (!$this->filters) {
         $this->filters = Collection::make(Request::capture()->except(['limit', 'page', 'download']));
     }
     return $this->filters;
 }
开发者ID:paybreak,项目名称:basket,代码行数:13,代码来源:FilterTrait.php

示例7: setGlobal

 public function setGlobal(swoole_http_request $request)
 {
     $global_arr = ['get' => '_GET', 'post' => '_POST', 'files' => '_FILES', 'cookie' => '_COOKIE', 'server' => '_SERVER'];
     foreach ($global_arr as $skey => $globalname) {
         if (!empty($request->{$skey})) {
             ${$globalname} = $request->{$skey};
         } else {
             ${$globalname} = [];
         }
     }
     if (!empty($_SERVER)) {
         foreach ($_SERVER as $key => $value) {
             $_SERVER[strtoupper($key)] = $value;
         }
     }
     $_REQUEST = array_merge($_GET, $_POST, $_COOKIE);
     $_SERVER['REQUEST_METHOD'] = $request->server['request_method'];
     $_SERVER['REQUEST_URI'] = $request->server['request_uri'];
     $_SERVER['REMOTE_ADDR'] = $request->server['remote_addr'];
     foreach ($request->header as $key => $value) {
         $_key = 'HTTP_' . strtoupper(str_replace('-', '_', $key));
         $_SERVER[$_key] = $value;
     }
     \Illuminate\Http\Request::capture();
 }
开发者ID:pauldo,项目名称:lswoole,代码行数:25,代码来源:HttpServer.php

示例8: getPageLimit

 /**
  * Get Page Limit
  *
  * @author MS
  */
 protected function getPageLimit()
 {
     if (Request::capture()->get('limit') && is_numeric(Request::capture()->get('limit'))) {
         return Request::capture()->get('limit');
     }
     return static::PAGE_LIMIT ? static::PAGE_LIMIT : 15;
 }
开发者ID:paybreak,项目名称:basket,代码行数:12,代码来源:LimitTrait.php

示例9: saveQuestion

 public function saveQuestion($PostID)
 {
     if (!AuthController::checkPermission()) {
         return redirect('/');
     }
     $data = Request::capture();
     $question = new Questions();
     $question->PostID = $PostID;
     $question->ThumbnailID = $data['ThumbnailID'];
     $question->Question = $data['Question'];
     $question->Description = $data['Description'];
     switch ($data['ThumbnailID']) {
         case '1':
             // Photo
             $question->save();
             $question = Questions::orderBy('id', 'desc')->first();
             //Photo
             $file = Request::capture()->file('Photo');
             if ($file != null) {
                 $question->Photo = 'Question_' . $PostID . '_' . $question->id . "_-Evangels-English-www.evangelsenglish.com_" . "." . $file->getClientOriginalExtension();
                 $file->move(base_path() . '/public/images/imageQuestion/', $question->Photo);
             }
             $question->update();
             break;
         case '2':
             // Video
             $linkVideo = $data['Video'];
             $question->Video = PostsController::getYoutubeVideoID($linkVideo);
             $question->save();
             break;
     }
     echo $question->id;
     return;
 }
开发者ID:kevinhoa95,项目名称:e-learning,代码行数:34,代码来源:QuestionsController.php

示例10: setActive

 public static function setActive($path, $active = 'active')
 {
     //funcion para agregar la clase active en el menu del sistema
     if (Str::contains(Request::capture()->path(), 'auth')) {
         return '';
     }
     return Str::contains(Request::capture()->path(), $path) ? $active : '';
 }
开发者ID:diego1q2w,项目名称:validador,代码行数:8,代码来源:general.php

示例11: transformException

 /**
  * Transform a Laravel exception into an API exception.
  *
  * @param  Exception $exception
  * @return void
  */
 protected function transformException(Exception $exception)
 {
     if (Request::capture()->wantsJson()) {
         $this->transformAuthException($exception);
         $this->transformEloquentException($exception);
         $this->transformValidationException($exception);
     }
 }
开发者ID:flugger,项目名称:laravel-responder,代码行数:14,代码来源:HandlesApiErrors.php

示例12: run

 public function run()
 {
     $router = new Router(new Dispatcher($this->container), $this->container);
     $router->get('/', HomeController::class . '@index');
     $router->get('/responsabilidad/{id}', HomeController::class . '@show');
     $response = $router->dispatch(Request::capture());
     $response->send();
 }
开发者ID:henryguerro,项目名称:notificaciones,代码行数:8,代码来源:Application.php

示例13: run

 public function run()
 {
     $router = new \Illuminate\Routing\Router(new \Illuminate\Events\Dispatcher($this->container), $this->container);
     $router->get('/', \platzi\Http\Controllers\HomeController::class . '@index');
     $router->get('/post/{id}', \platzi\Http\Controllers\HomeController::class . '@show');
     //$request = Request::capture();
     $response = $router->dispatch(\Illuminate\Http\Request::capture());
     $response->send();
 }
开发者ID:juandgomez,项目名称:php,代码行数:9,代码来源:Application.php

示例14: __construct

 private function __construct($name)
 {
     $this->request = Request::capture();
     $this->db = app(DatabaseManager::class);
     if (!$this->request->has('_DataTableQuery')) {
         throw new \Exception('Invalid input data for DataTableQuery: ' . print_r($this->request->all(), true));
     }
     $this->filters = json_decode($this->request->_DataTableQuery[$name])->{$name};
 }
开发者ID:girolando,项目名称:componente-animal,代码行数:9,代码来源:DataTableQuery.php

示例15: render

 /**
  * Render a tree.
  *
  * @return \Illuminate\Http\JsonResponse|string
  */
 public function render()
 {
     if (Request::capture()->has('_tree')) {
         return response()->json(['status' => $this->saveTree(Request::capture()->get('_tree'))]);
     }
     $this->buildupScript();
     AdminManager::script($this->script);
     view()->share(['path' => $this->path]);
     return view('admin::tree', $this->variables())->render();
 }
开发者ID:z-song,项目名称:laravel-admin,代码行数:15,代码来源:Tree.php


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