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


PHP request::except方法代码示例

本文整理汇总了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');
     }
 }
开发者ID:quangtruong16994,项目名称:laravel,代码行数:15,代码来源:HomeController.php

示例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']);
 }
开发者ID:abhilash698,项目名称:kachingApp,代码行数:14,代码来源:AdminController.php

示例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']);
 }
开发者ID:abhilash698,项目名称:kachingApp,代码行数:17,代码来源:MerchantService.php


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