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


PHP Request::toArray方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $data = $request->toArray();
     $data['amount'] = preg_replace("/[^0-9\\.]/", "", $data['amount']);
     Expense::create($data);
     return redirect('/expense');
 }
开发者ID:taylordaughtry,项目名称:WeeklyWorth,代码行数:13,代码来源:ExpensesController.php

示例2: selectCar

 /**
  * Show Insurance page.
  *
  * @param Request $request
  *
  * @return Redirect
  */
 public function selectCar(Request $request)
 {
     /*
      * Put all the request info including order info
      * to session, for next pages use.
      */
     Session::put('orderInfo', $request->toArray());
     return redirect('/reservation/insurance');
 }
开发者ID:leonlianght,项目名称:AlwaysRejoice,代码行数:16,代码来源:OrderController.php

示例3: authenticate

 /**
  * Login In User
  *
  * @param Request $request
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function authenticate(Request $request)
 {
     $validator = $this->getValidationFactory()->make($request->toArray(), ['credential' => 'required', 'password' => 'required|min:6']);
     if ($validator->fails()) {
         return response()->json(['error' => $validator->errors()]);
     }
     $field = filter_var($request->input('credential'), FILTER_VALIDATE_EMAIL) ? 'email' : 'username';
     $request->merge([$field => $request->input('credential')]);
     if (!$this->auth->attempt($request->only($field, 'password'))) {
         return response()->json(['error' => 'invalid_username_or_password']);
     }
     dispatch(new GenerateTokenJob($this->auth->user(), true));
     /** @var User $user */
     $user = $this->auth->user()->load('codes', 'codes.product', 'codes.product.extras', 'codes.product.profile');
     /**
      * inject product combination if not admin
      */
     $this->injectProductCombo($user);
     /**
      * Give all Products to admins
      */
     $this->adminFunction($user);
     return response()->json($user);
 }
开发者ID:SkysoulDesign,项目名称:mirage.dev,代码行数:30,代码来源:AuthController.php

示例4: toArray

 /**
  * Get all of the input and files for the request.
  *
  * @return array 
  * @static 
  */
 public static function toArray()
 {
     return \Illuminate\Http\Request::toArray();
 }
开发者ID:andybolano,项目名称:viaja_seguro,代码行数:10,代码来源:_ide_helper.php

示例5: sort

 public function sort(Request $request)
 {
     $this->getQuery()->where($request->toArray());
     return $this->response();
 }
开发者ID:garrinar,项目名称:laravel,代码行数:5,代码来源:GridController.php

示例6: index

 public function index(Request $request)
 {
     // Handles requests such as ".../api/agendas?description='hej'"
     return response(Agenda::where($request->toArray())->get());
 }
开发者ID:ninaolo,项目名称:DH2642-project,代码行数:5,代码来源:AgendasController.php

示例7: manyToMany

 /**
  * ManyToMany generate.
  *
  * @param \Illuminate\Http\Request
  *
  * @return \Illuminate\Http\Response
  */
 public function manyToMany(Request $request)
 {
     if ($this->check($request->toArray())) {
         Session::flash('status', 'Error! can not be related');
         return redirect('scaffold');
     }
     $manytomany = new \Amranidev\ScaffoldInterface\ManyToMany\ManyToMany($request->except('_token'));
     $manytomany->burn();
     Session::flash('status', 'ManyToMany generated successfully');
     return redirect('/scaffold');
 }
开发者ID:amranidev,项目名称:scaffold-interface,代码行数:18,代码来源:GuiController.php

示例8: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     \Log::info('request', $request->toArray());
     return $next($request);
 }
开发者ID:ry-htr,项目名称:laravel-sample,代码行数:13,代码来源:MyMiddleware.php

示例9: index

 public function index(Request $request)
 {
     // Handles requests such as ".../api/activities?agenda_id=1&type=someType"
     return response(Activity::where($request->toArray())->get());
 }
开发者ID:ninaolo,项目名称:DH2642-project,代码行数:5,代码来源:ActivitiesController.php


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