本文整理汇总了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;
}
示例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');
}
示例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('/');
}
}
}
示例4: store
public function store($id)
{
$user = User::findOrFail($id);
$input = Input::all();
$this->message->storeMessage($user, $input);
return redirect('messages');
}
示例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]);
}
示例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');
}
示例7: read
public function read()
{
if (!$this->hasPermission($this->menuPermissionName)) {
return view($this->viewPermissiondeniedName);
}
GridEncoder::encodeRequestedData(new DepartmentRepository(), Input::all());
}
示例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;
}
示例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');
}
}
示例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');
}
}
}
示例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);
}
示例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');
}
}
示例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()]);
}
示例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.');
}
示例15: getSearch
public function getSearch()
{
$filters = Input::all();
$launcher = new ShoppingEngine\Dispatcher();
$response = $launcher->launchSearch($filters);
return response()->json($response);
}