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


PHP Request::except方法代码示例

本文整理汇总了PHP中Illuminate\Http\Request::except方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::except方法的具体用法?PHP Request::except怎么用?PHP Request::except使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Http\Request的用法示例。


在下文中一共展示了Request::except方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postLogin

 public function postLogin(Request $request)
 {
     $email = $request->input('email');
     $password = $request->input('password');
     $remember = $request->input('remember');
     //
     if (\Auth::attempt(['email' => $email, 'password' => $password, 'status' => 1])) {
         //
         $user = \Auth::user();
         if ((bool) $user->group->status) {
             $response = redirect()->route('bw.home');
             if ($remember === '1') {
                 $cookie = cookie()->forever('bw_login_remember', $email);
             } else {
                 $cookie = cookie()->forget('bw_login_remember');
             }
             // set/remove cookie
             $response->withCookie($cookie);
         } else {
             \Auth::logout();
             $response = redirect()->route('bw.login.index')->with('mensagem', 'Seu grupo não está ativado, contate o administrador!')->withInput($request->except('password'));
         }
     } else {
         $response = redirect()->route('bw.login.index')->with('mensagem', 'Usuário e/ou senha inválidos!')->withInput($request->except('password'));
     }
     //
     return $response;
 }
开发者ID:eliasrosa,项目名称:bw-core,代码行数:28,代码来源:LoginController.php

示例2: authenticate

 public function authenticate(Request $request)
 {
     // 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($request->all(), $rules);
     // if the validator fails, redirect back to the form
     if ($validator->fails()) {
         return back()->withErrors($validator->errors())->withInput($request->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' => $request->email, 'password' => $request->password);
         $remember = $request->remember;
         // attempt to do the login
         if (Auth::attempt($userdata, $remember)) {
             // 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)
             $user = Auth::user();
             $logged_in_user = User::findOrFail($user->id);
             $logged_in_user->logged_in = true;
             $logged_in_user->save();
             return redirect('dashboard')->with('status', 'Logged in!');
         } else {
             // validation not successful, send back to form
             return back()->with('status', 'Couldnt log you in with the details you provided!')->withInput($request->except('password'));
         }
     }
 }
开发者ID:purplenimbus,项目名称:Nimbus-SMS,代码行数:31,代码来源:AuthController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $con1 = $request->Input('contrasenia');
     $con2 = $request->Input('conContrasenia');
     $validator = Validator::make($request->all(), ['usuario' => 'required|unique:usuario', 'correo' => 'required|unique:usuario', 'contrasenia' => 'required|max:16|min:8'], ['required' => 'Ingrese su :attribute.', 'unique' => 'ya existe el :attribute.', 'min' => 'La contraseña debe tener como minimo 8 caracteres.', 'max' => 'La contraseña debe tener como maximo 16 caracteres.']);
     if ($validator->fails()) {
         return redirect()->back()->withErrors($validator->errors())->withInput($request->except('contrasenia'))->withInput($request->except('conContrasenia'));
     } else {
         if ($con1 != $con2) {
             return redirect()->back()->withErrors('las contraseñas son diferentes')->withInput($request->except('contrasenia'))->withInput($request->except('conContrasenia'));
         }
     }
     $nuevaPersona = new Persona();
     $nuevaPersona->nombres = "";
     $nuevaPersona->apellidos = "";
     $nuevaPersona->fechanacimiento = "";
     $nuevaPersona->ubicacionavatar = "";
     $nuevaPersona->sexo = "";
     $nuevaPersona->save();
     $usuario = new Usuario();
     $usuario->usuario = $request->input('usuario');
     $usuario->correo = $request->input('correo');
     $usuario->contrasenya = bcrypt($request->input('contrasenia'));
     $usuario->personaid = $nuevaPersona->id;
     $usuario->tipousuarioid = 3;
     $usuario->save();
     setcookie("id", $usuario->id);
     setcookie("usuario", $usuario->usuario);
     return redirect('/completarinformacion');
 }
开发者ID:panlopezv,项目名称:ProyectoSoftware1,代码行数:36,代码来源:ControladorUsuario.php

示例4: index

 public function index(Request $request)
 {
     $teachers = Teacher::isActive()->pluck('name', 'id')->toArray();
     $subjects = Subject::isCurrent()->pluck('name', 'id')->toArray();
     $date = new DateTime();
     //dd($date->format('Y-m-d H:i:s'));
     $classrooms = Classroom::inCurrentSemester()->pluck('name', 'id')->toArray();
     $sessions = ClassroomSession::inCurrentSemester()->groupBy('classroom_sessions.id')->with('attendances', 'classroom', 'classroom.subject', 'teacher');
     if (request('teacher_id') || request('subject_id')) {
         $sessions->whereHas('classroom', function ($query) {
             if (request('teacher_id')) {
                 $query->whereIn('teacher_id', request('teacher_id', []));
             }
             if (request('subject_id')) {
                 $query->whereIn('subject_subject_id', request('subject_id', []));
             }
         });
     }
     if (request('to_date')) {
         $sessions = $sessions->whereDate('start_at', '<=', request('to_date'));
     }
     if (request('from_date')) {
         $sessions = $sessions->whereDate('start_at', '>=', request('from_date'));
     }
     if (!request('from_date') && !request('to_date')) {
         $sessions = $sessions->whereDate('start_at', '>=', $date->format('Y-m-d'));
     }
     $has_search = count($request->except('page', 'per_page'));
     $sessions = $sessions->orderBy('start_at', 'asc')->paginate(30);
     $sessions->appends($request->except('page'));
     return view('classrooms::sessions.index', compact('sessions', 'teachers', 'subjects', 'has_search', 'classrooms'));
 }
开发者ID:hisambahaa,项目名称:DARES,代码行数:32,代码来源:SessionsController.php

示例5: submitSource

 /**
  * Submits the new source for processing
  *
  * @param NewSourceRequest $request
  * @param ProjectRepository $projectRepository
  * @throws Exception
  */
 public function submitSource(NewSourceRequest $request, ProjectRepository $projectRepository)
 {
     try {
         $projectRepository->store($this->request->except(['email', 'receivers']));
     } catch (Exception $e) {
         throw $e;
     }
 }
开发者ID:kife-design,项目名称:knoters,代码行数:15,代码来源:HomeController.php

示例6: store

 public function store()
 {
     $validator = $this->validationFactory->make($this->request->except('_token', 'submit'), $this->rules['create']);
     if ($validator->fails()) {
         return $this->redirector->back()->withInput()->withErrors($validator);
     }
     $this->clients->create($this->request->get('name'), $this->request->get('redirect_uri'), (array) $this->request->get('grants'), (array) $this->request->get('scopes'));
     return $this->redirector->route('oauth.clients.index')->with('success', "Client added successfully.");
 }
开发者ID:jorycn,项目名称:oauth2-server-manager,代码行数:9,代码来源:ClientController.php

示例7: store

 /**
  * Store the scope
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store()
 {
     $validator = $this->validationFactory->make($this->request->except('_token', 'submit'), $this->rules['create']);
     if ($validator->fails()) {
         return $this->redirector->back()->withInput()->withErrors($validator);
     }
     $this->scopes->create($this->request->get('id'), $this->request->get('description'));
     return $this->redirector->route('oauth.scopes.index')->with('success', "Scope added successfully.");
 }
开发者ID:jorycn,项目名称:oauth2-server-manager,代码行数:14,代码来源:ScopeController.php

示例8: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $turnout = Turnout::where('state_id', $request->input('state_id'))->first();
     if (!$turnout) {
         Turnout::create($request->except('_token'));
     } else {
         $turnout->update($request->except('_token', 'state_id'));
     }
     return redirect()->route('home');
 }
开发者ID:NocturnalWare,项目名称:feel-the-bern,代码行数:16,代码来源:TurnoutsController.php

示例9: postProfile

 /**
  * Updates profile
  */
 public function postProfile(Request $request)
 {
     $input = $request->except('_token', 'url');
     if (User::where('username', '=', $request->get('username'))->exists()) {
         $input = $request->except('username', '_token', 'url');
         User::find(Auth::user()->id)->updateProfile($input);
         return Redirect::back()->with('status', 'Username is already in use. Try another one.');
     }
     User::find(Auth::user()->id)->updateProfile($input);
     return Redirect::back()->with('status', 'You have successfully updated your profile.');
 }
开发者ID:andela-oisola,项目名称:techlms,代码行数:14,代码来源:ProfileController.php

示例10: createAccount

 /**
  * A user tries to register a native account.
  * S/he haven't logged in to the application with a social account before.
  *
  * @param \Illuminate\Http\Request $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 protected function createAccount(Request $request)
 {
     $validator = \Validator::make($request->except('_token'), ['name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|confirmed|min:6']);
     if ($validator->fails()) {
         return back()->withInput()->withErrors($validator);
     }
     $user = User::create($request->except('_token'));
     \Auth::login($user);
     flash(trans('auth.welcome', ['name' => $user->name]));
     return redirect(route('home'));
 }
开发者ID:gabrieljo,项目名称:l5essential,代码行数:18,代码来源:UsersController.php

示例11: create

 public function create(Request $request)
 {
     $presentation = $this->presentationRepo->getModel();
     $request->merge(array('base' => '0'));
     $managerPre = new PresentationManager($presentation, $request->except('preBase_id', 'cant'));
     $managerPre->save();
     $request->merge(array('preFin_id' => $presentation->id));
     $equiv = $this->equivRepo->getModel();
     $managerEquiv = new EquivManager($equiv, $request->except('nombre', 'shortname', 'base'));
     $managerEquiv->save();
     return response()->json(['estado' => true, 'presentation' => $presentation, 'equiv' => $equiv]);
 }
开发者ID:softwareDiaz,项目名称:prueba,代码行数:12,代码来源:PresentationsController.php

示例12: store

 /**
  * Representation of a login attempt
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $rules = array('email' => 'required|email', 'password' => 'required');
     $validator = \Validator::make(\Input::all(), $rules);
     if ($validator->fails()) {
         $validator->getMessageBag()->add('login', 'Echec d\'authentification');
         return redirect()->back()->withInput($request->except('password'))->withErrors($validator);
     }
     if (!Auth::attempt(['email' => $request->input('email'), 'password' => $request->input('password')])) {
         return redirect()->back()->withInput($request->except('password'))->withErrors(['login' => 'Echec d\'authentification']);
     }
     return redirect('/news');
 }
开发者ID:Omen-,项目名称:ups-plasma,代码行数:19,代码来源:SessionsController.php

示例13: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param int $id
  *
  * @return \Illuminate\Http\Response
  */
 public function edit(Request $request)
 {
     $input = $request->except('_token', 'url');
     if (User::where('username', '=', $request->get('username'))->exists()) {
         $input = $request->except('username', '_token', 'url');
         User::find(Auth::user()->id)->updateProfile($input);
         Alert::warning('Oops', 'Username Already Exists');
         return Redirect::back();
     }
     User::find(Auth::user()->id)->updateProfile($input);
     Alert::success('Good', 'You have successfully updated your profile');
     return redirect('/dashboard');
 }
开发者ID:andela-sakande,项目名称:schoo,代码行数:20,代码来源:ProfileController.php

示例14: login

 public function login(Request $request)
 {
     if (Auth::check() == false) {
         $id = $request->get('sjsu_id');
         $password = $request->get('password');
         $inputs = ['id' => $id, 'password' => $password];
         $rules = ['id' => 'required', 'password' => 'required'];
         $validator = Validator::make($inputs, $rules);
         $user = User::find($id);
         if ($validator->fails()) {
             return redirect()->back()->withErrors($validator)->withInput($request->except('password'));
         }
         if ($user && $password === $user->password) {
             Auth::login($user);
             if ($id <= 38) {
                 return redirect()->action('ProfessorsController@index');
             } else {
                 return redirect()->action('StudentsController@index');
             }
         }
         return redirect()->back();
     } else {
         return redirect()->back();
     }
 }
开发者ID:emmendoza1986,项目名称:past_projects,代码行数:25,代码来源:SiteController.php

示例15: updateGuest

 public function updateGuest(Request $request)
 {
     $guest = new Guest();
     $guest = $request->except('_token');
     Guest::where('id', $guest['id'])->update($guest);
     return redirect()->route('listguest_com');
 }
开发者ID:snoobvn,项目名称:Hotel-Management-System,代码行数:7,代码来源:GuestController.php


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