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