本文整理汇总了PHP中request::except方法的典型用法代码示例。如果您正苦于以下问题:PHP request::except方法的具体用法?PHP request::except怎么用?PHP request::except使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::except方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public function login()
{
$rules = array('email' => 'required|email', 'password' => 'required|min:6');
$messages = ['email.required' => 'Yêu cầu nhập email.', 'email.email' => 'Email sai định dạng. Yêu cầu nhập lại.', 'password.required' => 'Yêu cầu nhập mật khẩu.', 'password.min' => 'Mật khẩu cần lớn hơn hoặc bằng 6.'];
$validator = Validator::make(request::all(), $rules, $messages);
if ($validator->fails()) {
return view::make('admin/login')->withInput(request::except('password'))->withErrors($validator);
}
$userdata = array('email' => Input::get('email'), 'password' => Input::get('password'));
if (Auth::attempt($userdata)) {
return view::make('admin/index');
} else {
return view::make('admin/login');
}
}
示例2: updateOffer
public function updateOffer(request $request)
{
$validator = Validator::make($request->all(), ['offer_id' => 'required', 'title' => 'required|max:255', 'startDate' => 'required|date', 'endDate' => 'required|date', 'fineprint' => 'required|min:5']);
$input = $request->only('offer_id');
if ($validator->fails()) {
return redirect('admin/offer/' . $input["offer_id"] . '/edit')->withErrors($validator);
}
$offer = Offers::where('id', $input['offer_id'])->first();
foreach ($request->except('_token', 'offer_id') as $key => $value) {
$offer->{$key} = $value;
}
$offer->save();
return redirect('admin/offer/' . $input['offer_id']);
}
示例3: editOffer
public function editOffer(request $request)
{
$input = $request->only('store_id', 'offer_id');
if (!$this->checkUserHasStore($input['store_id'], true)) {
return response()->json(['response_code' => 'ERR_UNA', 'messages' => 'User Not Authorized'], 403);
}
$matchThese = ['id' => $input['offer_id'], 'store_id' => $input['store_id']];
$offer = Offers::where($matchThese)->first();
if (empty($offer)) {
return response()->json(['response_code' => 'RES_OU', 'messages' => 'Offer Updated']);
}
foreach ($request->except('offer_id', 'store_id', 'api_key') as $key => $value) {
$offer->{$key} = $value;
}
$offer->save();
return response()->json(['response_code' => 'RES_OU', 'messages' => 'Offer Updated']);
}