當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Input::all方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Input::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Input::all方法的具體用法?PHP Input::all怎麽用?PHP Input::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Input的用法示例。


在下文中一共展示了Input::all方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createRequestFromGlobals

 public function createRequestFromGlobals()
 {
     // Patch headerless bearer
     $headers = Input::get('access_token') ? array('AUTHORIZATION' => 'Bearer ' . Input::get('access_token')) : null;
     $request = new Request($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER, Input::all(), $headers);
     return $request;
 }
開發者ID:cloudoki,項目名稱:oauth2-stack,代碼行數:7,代碼來源:Oauth2Verifier.php

示例2: update

 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, $id)
 {
     $service = service::findOrFail($id);
     $validator = Validator::make($data = Input::all(), service::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     /**
      * Check if Request param contains
      * status, if so activate
      * if not deactivate status
      */
     $status_exists = false;
     foreach ($data as $key => $value) {
         if ($key == 'status') {
             $status_exists = true;
         }
     }
     if ($status_exists) {
         $data['status'] = 1;
     } else {
         $data['status'] = 0;
     }
     $service->update($data);
     return Redirect::route('admin.services.index');
 }
開發者ID:hshifaz,項目名稱:website,代碼行數:33,代碼來源:servicesController.php

示例3: store

 /**
  * Handle an authentication attempt.
  *
  * @return Response
  */
 public function store()
 {
     $rules = array('email' => 'required|email', 'password' => 'required');
     $validate = Validator::make(Input::all(), $rules);
     if ($validate->fails()) {
         return Redirect::to('/');
     } else {
         if (Auth::attempt(array('email' => Input::get('email'), 'password' => Input::get('password'), 'status' => 'Activate'))) {
             /*$user = User::where('email','=',$email)->get();
               Session::put('user_type',$user[0]->role);
               $id = $user[0]->id;
               Session::put('created_by',$id);*/
             Session::put('user_id', Auth::user()->id);
             Session::put('user_name', Auth::user()->username);
             Session::put('user_role', Auth::user()->role);
             Session::flash('message', 'User has been Successfully Login.');
             $roles = Auth::user()->role;
             if ($roles = 'admin' || 'manager') {
                 return Redirect::to('dashboard');
             } elseif ($roles = 'user') {
                 return Redirect::to('profile');
             }
         } else {
             Session::flash('message', 'Your username or password incorrect');
             return Redirect::to('/');
         }
     }
 }
開發者ID:woakes070048,項目名稱:cemcoErp,代碼行數:33,代碼來源:AuthController.php

示例4: store

 public function store($id)
 {
     $user = User::findOrFail($id);
     $input = Input::all();
     $this->message->storeMessage($user, $input);
     return redirect('messages');
 }
開發者ID:mathewsandi,項目名稱:Practice,代碼行數:7,代碼來源:MessageController.php

示例5: postOrder

 public function postOrder()
 {
     log::debug('postOrder::Input params');
     log::debug(Input::all());
     //Validation rules
     $rules = array('pizza_marinara' => array('required', 'integer', 'between:0,3'), 'pizza_margherita' => array('required', 'integer', 'between:0,3'), 'olio' => array('min:1|max:20'), 'name' => array('required', 'min:1|max:20'), 'email' => array('required', 'email', 'min:1|max:20'), 'freeOrder' => array('exists:menu,dish'));
     // The validator
     $validation = Validator::make(Input::all(), $rules);
     // Check for fails
     if ($validation->fails()) {
         // Validation has failed.
         log::error('Validation has failed');
         $messages = $validation->messages();
         $returnedMsg = "";
         foreach ($messages->all() as $message) {
             $returnedMsg = $returnedMsg . " - " . $message;
         }
         log::error('Validation fail reason: ' . $returnedMsg);
         return redirect()->back()->withErrors($validation);
     }
     log::debug('Validation passed');
     $msg = array('email' => Input::get('email'), 'name' => Input::get('name'));
     $response = Event::fire(new ExampleEvent($msg));
     $response = Event::fire(new OrderCreated($msg));
     return view('orderdone', ['msg' => $msg]);
 }
開發者ID:WebYourMind,項目名稱:courses-laravel5,代碼行數:26,代碼來源:NewOrderController.php

示例6: uploadFiles

 public function uploadFiles(Request $request)
 {
     $input = Input::all();
     //        $rules = array(
     //            'file' => 'image|max:3000',
     //        );
     //
     //        $validation = Validator::make($input, $rules);
     //
     //        if ($validation->fails()) {
     //            return Response::make($validation->errors->first(), 400);
     //        }
     $destinationPath = 'uploads';
     // upload path
     $extension = Input::file('file')->getClientOriginalExtension();
     // getting file extension
     $fileName = rand(11111, 99999) . '.' . $extension;
     // renameing image
     $upload_success = Input::file('file')->move($destinationPath, $fileName);
     // uploading file to given path
     //        if ($request->file('file')->isValid()) {
     //            return Response::json('success', 200);
     //        } else {
     //            return Response::json('error', 400);
     //        }
     //        return Response::json('success');
 }
開發者ID:EthanK28,項目名稱:laravel-with-jquery-upload,代碼行數:27,代碼來源:DropZoneController.php

示例7: read

 public function read()
 {
     if (!$this->hasPermission($this->menuPermissionName)) {
         return view($this->viewPermissiondeniedName);
     }
     GridEncoder::encodeRequestedData(new DepartmentRepository(), Input::all());
 }
開發者ID:x-Zyte,項目名稱:nissanhippro,代碼行數:7,代碼來源:DepartmentController.php

示例8: updateMultiple

 public function updateMultiple()
 {
     $inputs = Input::all();
     $collection = new Collection();
     for ($i = 0; $i < sizeOf($inputs); $i++) {
         // get input item
         //
         $input = $inputs[$i];
         if (array_key_exists('restricted_domain_id', $input)) {
             // find existing model
             //
             $restrictedDomainId = $input['restricted_domain_id'];
             $restrictedDomain = RestrictedDomain::where('restricted_domain_id', '=', $restrictedDomainId)->first();
             $collection->push($restrictedDomain);
         } else {
             // create new model
             //
             $restrictedDomain = new RestrictedDomain();
         }
         // update model
         //
         $restrictedDomain->domain_name = $input['domain_name'];
         $restrictedDomain->description = $input['description'];
         // save model
         //
         $restrictedDomain->save();
     }
     return $collection;
 }
開發者ID:pombredanne,項目名稱:open-swamp,代碼行數:29,代碼來源:RestrictedDomainsController.php

示例9: getAttendance

 function getAttendance($member = '')
 {
     $input = Input::all();
     if ($member == null or $member == '') {
         $memberId = Session::get('memberId');
     } else {
         $memberId = $member;
     }
     if (array_key_exists('date', $input)) {
         $year = date("Y", strtotime($input['date']));
         $startDate = $year . '-01-01';
         $endDate = $startDate . '12-31';
     } else {
         $year = date("Y");
         $startDate = $year . '-01-01';
         $endDate = $year . '-12-31';
     }
     $month = array_key_exists('month', $input) ? $input['month'] : date('F');
     $month = Month::ForMonth($month)->first();
     if (!empty($month)) {
         $attendance = $month->attendances()->DateBetween($startDate, $endDate)->ForMember($memberId)->get();
         $attendances = $this->AverageMonthAttendance($attendance, $month, $year);
         return $attendances;
     } else {
         return Redirect::to('/auth/dashboard')->withFlashMessage('No Attendnce for the month');
     }
 }
開發者ID:sandyp143,項目名稱:attendance-system,代碼行數:27,代碼來源:AttendanceController.php

示例10: doLogin

 public function doLogin()
 {
     // validate the info, create rules for the inputs
     $rules = array('email' => 'required|email', 'password' => 'required|alphaNum|min:3');
     // run the validation rules on the inputs from the form
     $validator = Validator::make(Input::all(), $rules);
     // if the validator fails, redirect back to the form
     if ($validator->fails()) {
         return redirect('login')->withErrors($validator)->withInput(Input::except('password'));
         // send back the input (not the password) so that we can repopulate the form
     } else {
         // create our user data for the authentication
         $userdata = array('email' => Input::get('email'), 'password' => Input::get('password'));
         // attempt to do the login
         if (Auth::attempt($userdata)) {
             // validation successful!
             // redirect them to the secure section or whatever
             // return Redirect::to('secure');
             // for now we'll just echo success (even though echoing in a controller is bad)
             return redirect('admin');
         } else {
             // validation not successful, send back to form
             return redirect('login');
         }
     }
 }
開發者ID:pechatny,項目名稱:kolizej,代碼行數:26,代碼來源:HomeController.php

示例11: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(ItemRequest $request)
 {
     //
     $request->except('_token');
     $item = new Item($request->all());
     $cols = $item->current_columns();
     $alert = $message = NULL;
     try {
         $alert = 'alert_success';
         $input = Input::all();
         $length = count($input['style_no']);
         for ($i = 0; $i < $length; $i++) {
             $item = !isset($item) ? new Item() : $item;
             $item->vendor_id = $input['vendor'];
             $item->measure = $input['measure'];
             $item->date = date('Y-m-d H:i:s');
             $item->container = $input['container'];
             $item->receive = $input['receive'];
             foreach ($cols as $key => $val) {
                 $item->{$val} = $input[$val][$i];
             }
             $item->save();
             unset($item);
         }
         $message = 'Adding item Successful.';
     } catch (Exception $e) {
         $alert = 'alert_danger';
         $message = $e->getMessage();
     }
     return redirect('/item/create')->with($alert, $message);
 }
開發者ID:kevin-ngn,項目名稱:warehouse.demo,代碼行數:37,代碼來源:ItemController.php

示例12: store

 public function store(Request $request)
 {
     $rules = array('dmm4-7' => 'required', 'dmm8-13' => 'required', 'dfgd8-13' => 'required', 'lmm4-7' => 'required', 'lmm8-10' => 'required', 'lmm11-13' => 'required', 'lfgd8-13' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     // if the validator fails, redirect back to the form
     if ($validator->fails()) {
         session()->flash('error_message', " You can't leave this all empty.");
         session()->flash('error_message2', " You can use letters, numbers, Periods, and Hyphen.");
         return Redirect::back()->withErrors($validator)->withInput();
         $input = input::all();
     } else {
         $id = $request->input('id');
         $data = ServSetModel::find($id);
         $data->mm_4_17_db_server = $request->input('dmm4-7');
         $data->mm_8_13_db_server = $request->input('dmm8-13');
         //$data->mm_11_13_db_server = $request->input('dmm11-13');
         $data->fgd_8_13_db_server = $request->input('dfgd8-13');
         $data->mm_4_7_logs_server = $request->input('lmm4-7');
         $data->mm_8_10_logs_server = $request->input('lmm8-10');
         $data->mm_11_13_logs_server = $request->input('lmm11-13');
         $data->fgd_8_13_logs_server = $request->input('lfgd8-13');
         $data->save();
         session()->flash('message', ' Update successfuly.');
         return redirect('ais/serverSetting');
     }
 }
開發者ID:imakedev,項目名稱:ais5_2,代碼行數:26,代碼來源:ServController.php

示例13: remove

 public function remove()
 {
     $gamesModel = new GamesModel();
     $input = Input::all();
     $gamesModel->where('id', '=', $input['remove_id'])->delete();
     return view('pages.adminzone.games', ['title' => "Добавить игру", 'games' => $gamesModel->all()]);
 }
開發者ID:maxdoctorkurt,項目名稱:web,代碼行數:7,代碼來源:AdminzoneGamesController.php

示例14: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Forum $forum, Request $request)
 {
     $this->validate($request, $this->rules);
     $input = array_except(Input::all(), '_method');
     $forum->update($input);
     return Redirect::route('Forum.show', $forum->id)->with('message', 'Forum updated.');
 }
開發者ID:sarfraz-akhtar01,項目名稱:coutallure-laravel,代碼行數:13,代碼來源:ForumsController.php

示例15: getSearch

 public function getSearch()
 {
     $filters = Input::all();
     $launcher = new ShoppingEngine\Dispatcher();
     $response = $launcher->launchSearch($filters);
     return response()->json($response);
 }
開發者ID:asacc,項目名稱:latitude-pricewhizz,代碼行數:7,代碼來源:HomeController.php


注:本文中的Illuminate\Support\Facades\Input::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。