本文整理汇总了PHP中Input::except方法的典型用法代码示例。如果您正苦于以下问题:PHP Input::except方法的具体用法?PHP Input::except怎么用?PHP Input::except使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Input
的用法示例。
在下文中一共展示了Input::except方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created resource in storage.
* POST /users
*
* @return Response
*/
public function store()
{
Input::merge(array_map('trim', Input::all()));
$input = Input::all();
$validation = Validator::make($input, User::$rules);
if ($validation->passes()) {
DB::transaction(function () {
$user = new User();
$user->first_name = strtoupper(Input::get('first_name'));
$user->middle_initial = strtoupper(Input::get('middle_initial'));
$user->last_name = strtoupper(Input::get('last_name'));
$user->dept_id = Input::get('department');
$user->confirmed = 1;
$user->active = 1;
$user->email = Input::get('email');
$user->username = Input::get('username');
$user->password = Input::get('password');
$user->password_confirmation = Input::get('password_confirmation');
$user->confirmation_code = md5(uniqid(mt_rand(), true));
$user->image = "default.png";
$user->save();
$role = Role::find(Input::get('name'));
$user->roles()->attach($role->id);
});
return Redirect::route('user.index')->with('class', 'success')->with('message', 'Record successfully added.');
} else {
return Redirect::route('user.create')->withInput(Input::except(array('password', 'password_confirmation')))->withErrors($validation)->with('class', 'error')->with('message', 'There were validation errors.');
}
}
示例2: postRegistro
public function postRegistro()
{
include_once public_path() . '/securimage/securimage.php';
$securimage = new Securimage();
$captcha_sesion = strtoupper($securimage->getCode());
include app_path() . "/include/cifrado.php";
$usuario = new Usuario();
$data = Input::all();
$data['captcha_sesion'] = $captcha_sesion;
$data['captcha_code'] = strtoupper($data['captcha_code']);
$data['fecha_nacimiento'] = $data['anyo'] . "-" . $data['mes'] . "-" . $data['dia'];
foreach ($data as $key => $value) {
if ($key != 'password' && $key != 'email') {
$data[$key] = mb_strtoupper($value, 'UTF-8');
}
}
$data['password'] = encriptar($data['password']);
$data['cod_verif'] = rand(111111, 999999);
if (!$usuario->isValid($data)) {
return Redirect::action('Usuario_UsuarioController@getRegistro')->withInput(Input::except('password'))->withErrors($usuario->errors)->with('id_municipio', $data['municipio']);
}
$usuario->fill($data);
$usuario->save();
return Redirect::action('Usuario_UsuarioController@getVerificar', array($usuario->id))->with('message_ok', 'Registro Completado.
Por favor, inserte el código de verificación que le hemos enviado a su correo electrónico. Gracias');
}
示例3: 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::to('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)
echo 'SUCCESS!';
} else {
// validation not successful, send back to form
return Redirect::to('login');
}
}
}
示例4: updateProfile
public function updateProfile()
{
$name = Input::get('name');
//$username = Input::get('username');
$birthday = Input::get('birthday');
$bio = Input::get('bio', '');
$gender = Input::get('gender');
$mobile_no = Input::get('mobile_no');
$country = Input::get('country');
$old_avatar = Input::get('old_avatar');
/*if(\Cashout\Models\User::where('username',$username)->where('id','!=',Auth::user()->id)->count()>0){
Session::flash('error_msg', 'Username is already taken by other user . Please enter a new username');
return Redirect::back()->withInput(Input::all(Input::except(['_token'])));
}*/
try {
$profile = \Cashout\Models\User::findOrFail(Auth::user()->id);
$profile->name = $name;
// $profile->username = $username;
$profile->birthday = $birthday;
$profile->bio = $bio;
$profile->gender = $gender;
$profile->mobile_no = $mobile_no;
$profile->country = $country;
$profile->avatar = Input::hasFile('avatar') ? \Cashout\Helpers\Utils::imageUpload(Input::file('avatar'), 'profile') : $old_avatar;
$profile->save();
Session::flash('success_msg', 'Profile updated successfully');
return Redirect::back();
} catch (\Exception $e) {
Session::flash('error_msg', 'Unable to update profile');
return Redirect::back()->withInput(Input::all(Input::except(['_token', 'avatar'])));
}
}
示例5: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//Validate
$rules = array('name' => 'required');
$validator = Validator::make(Input::all(), $rules);
// process the validation
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput(Input::except('password'));
} else {
// Update
$commodity = Commodity::find($id);
$commodity->name = Input::get('name');
$commodity->description = Input::get('description');
$commodity->metric_id = Input::get('unit_of_issue');
$commodity->unit_price = Input::get('unit_price');
$commodity->item_code = Input::get('item_code');
$commodity->storage_req = Input::get('storage_req');
$commodity->min_level = Input::get('min_level');
$commodity->max_level = Input::get('max_level');
try {
$commodity->save();
return Redirect::route('commodity.index')->with('message', trans('messages.success-updating-commodity'))->with('activecommodity', $commodity->id);
} catch (QueryException $e) {
Log::error($e);
}
}
}
示例6: postLogin
public function postLogin()
{
// Get all the inputs
// id is used for login, username is used for validation to return correct error-strings
$userdata = array('id' => Input::get('username'), 'username' => Input::get('username'), 'password' => Input::get('password'));
// Declare the rules for the form validation.
$rules = array('username' => 'Required', 'password' => 'Required');
// Validate the inputs.
$validator = Validator::make($userdata, $rules);
// Check if the form validates with success.
if ($validator->passes()) {
// remove username, because it was just used for validation
unset($userdata['username']);
// Try to log the user in.
if (Auth::attempt($userdata)) {
// Redirect to homepage
return Redirect::to('')->with('success', 'You have logged in successfully');
} else {
// Redirect to the login page.
return Redirect::to('login')->withErrors(array('password' => 'Password invalid'))->withInput(Input::except('password'));
}
}
// Something went wrong.
return Redirect::to('login')->withErrors($validator)->withInput(Input::except('password'));
}
示例7: createStudent
public function createStudent()
{
$validator = $this->validateStudent(Input::all());
if ($validator->fails()) {
$messages = $validator->messages();
return Redirect::to('student-new')->withErrors($messages)->withInput(Input::except('password', 'password_confirmation'));
}
$input = Input::all();
//$input['dob'] = date('m-d-Y H:i:s', strtotime(Input::get('dob')));
$input['collegename'] = Admin::where('collegeid', '=', Session::get('user')->collegeid)->first()->collegename;
$input['collegeid'] = Session::get('user')->collegeid;
//$input['collegeid']="dummy";
//$input['collegename']="dummy";
$user = new User();
$user->email = $input['email'];
$user->password = Hash::make($input['password']);
$user->collegeid = $input['collegeid'];
$user->flag = 3;
$user->save();
$input['loginid'] = $user->id;
if (Input::hasFile('profilepic')) {
$input['profilepic'] = $this->filestore(Input::file('profilepic'), $user->id);
}
$removed = array('password', 'password_confirmation');
foreach ($removed as $k) {
unset($input[$k]);
}
Student::saveFormData($input);
return Redirect::to('student');
}
示例8: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$uId = \Input::get('user_id');
$date = \Input::get('date');
$check = \Payment::where('emp_id', '=', $uId)->where('pay_date', '=', $date)->first();
if ($check) {
echo '{"error":"already exits"}';
return;
} else {
$earn = \Input::get('earned');
$deduction = \Input::get('deducted');
$net = \Input::get('net');
$description = \Input::except('earned', 'deducted', 'net', 'date', 'date_of_salary', '_token', 'user_id');
$description = json_encode($description);
$insert = \Payment::insertGetId(array('emp_id' => $uId, 'earning_amount' => $earn, 'deducting_amount' => $deduction, 'total_amount' => $net, 'pay_date' => $date, 'description' => $description));
if ($insert) {
$ids = array('uId' => $uId, 'date' => $date, 'eId' => $insert);
$msg = array('success' => json_encode($ids));
echo json_encode($msg);
return;
} else {
echo '{"error":"already exits"}';
return;
}
}
}
示例9: updateUser
public function updateUser($user_id)
{
$name = Input::get('name');
$birthday = Input::get('birthday');
$bio = Input::get('bio', '');
$gender = Input::get('gender');
$mobile_no = Input::get('mobile_no');
$country = Input::get('country');
$old_avatar = Input::get('old_avatar');
$password = Input::get('password');
$password_confirmation = Input::get('password_confirmation');
try {
$profile = \Cashout\Models\User::findOrFail($user_id);
$profile->name = $name;
$profile->birthday = $birthday;
$profile->bio = $bio;
$profile->gender = $gender;
$profile->mobile_no = $mobile_no;
$profile->country = $country;
$profile->avatar = Input::hasFile('avatar') ? \Cashout\Helpers\Utils::imageUpload(Input::file('avatar'), 'profile') : $old_avatar;
if (strlen($password) > 0 && strlen($password_confirmation) > 0 && $password == $password_confirmation) {
$profile->password = Hash::make($password);
}
$profile->save();
Session::flash('success_msg', 'Profile updated successfully');
return Redirect::back();
} catch (\Exception $e) {
Session::flash('error_msg', 'Unable to update profile');
return Redirect::back()->withInput(Input::all(Input::except(['_token', 'avatar'])));
}
}
示例10: doMeta
public function doMeta()
{
$error = false;
// Set our metadata
Metadata::set(Input::except(['user', 'pass', '_token']));
Metadata::set('theme', 'default');
// Check the Stripe API key is valid
try {
Stripe::setApiKey(Metadata::item('stripe_key'));
Stripe\Balance::retrieve();
} catch (Exception $e) {
$error = 'That Stripe key doesn’t look valid!';
}
// Create the user
if (User::whereEmail(Input::get('user'))->exists()) {
// We're installing, can't have users already (I think)
// $error = 'Somebody’s already signed up with that email address!';
} else {
User::create(['username' => 'admin', 'name' => 'Administrator', 'level' => User::level('admin'), 'email' => Input::get('user'), 'password' => Input::get('pass')]);
}
if ($error === false) {
return Redirect::to('install/done');
}
View::share('error', $error);
return self::showMeta();
}
示例11: store
/**
* Stores new account
*
* @return Illuminate\Http\Response
*/
public function store()
{
$repo = App::make('UserRepository');
$user = $repo->signup(Input::all());
if ($user->id) {
try {
if (Config::get('confide::signup_email')) {
Mail::queueOn(Config::get('confide::email_queue'), Config::get('confide::email_account_confirmation'), compact('user'), function ($message) use($user) {
$message->to($user->email, $user->username)->subject(Lang::get('confide::confide.email.account_confirmation.subject'));
});
}
$role = Role::where('name', '=', 'admin')->first();
$user->roles()->attach($role->id);
$notice_msg = 'Su cuenta ha sido creada satisfactoriamente. Revisa tu correo';
return Redirect::action('UsersController@login')->with('notice', $notice_msg);
} catch (Exception $exc) {
$userReg = User::findOrFail($user->id);
$userReg->delete(['id']);
return Redirect::back()->with('error', 'Falló envío de correo, intente registrarse nuevamente');
}
} else {
$error = $user->errors()->all(':message');
return Redirect::back()->withInput(Input::except('password'))->with('error', $error);
}
}
示例12: postStore
public function postStore()
{
$postData = Input::all();
$rules = array('userName' => 'required|min:5', 'userEmail' => 'required|email', 'userMobile' => 'required|min:10|numeric', 'userAddress1' => 'required', 'userAddress2' => 'required', 'userPincode' => 'required|min:6|numeric', 'userCity' => 'required', 'userState' => 'required', 'userId' => 'required|alphanum');
$validator = Validator::make($postData, $rules);
if ($validator->fails()) {
return Redirect::to('admin/profile')->withInput()->withErrors($validator);
} else {
if (Input::has('userKey')) {
$rulespass = array('userKey' => 'required|min:6|alphanum', 'cpass' => 'required|min:6|same:userKey');
$validator1 = Validator::make($postData, $rulespass);
if ($validator1->fails()) {
return Redirect::to('admin/profile')->withInput()->withErrors($validator1);
} else {
$input = json_encode(Input::except('_token', 'cpass'));
$update = Sample::update($input);
//print_r($update);exit;
if ($update && $update->status == "success") {
return Redirect::to('admin/profile')->with('success', $update->message);
} else {
return Redirect::to('admin/profile')->with('failure', "something went wrong");
}
}
} else {
$input = json_encode(Input::except('_token', 'userKey', 'cpass'));
$update = Sample::update($input);
//print_r($update);exit;
if ($update && $update->status == "success") {
return Redirect::to('admin/profile')->with('success', $update->message);
} else {
return Redirect::to('admin/profile')->with('failure', "something went wrong");
}
}
}
}
示例13: store
/**
* Store a newly created resource in storage.
* @access public
* @return Redirect
*/
public function store()
{
// input data
$data = Input::except('_token', 'search');
// validation rules
$rules = $this->getValidationRules();
// validate data using rules
$validator = Validator::make($data, $rules);
if ($validator->fails()) {
if (!$data['aou_list_id']) {
$flashMessage = 'No sighting selected.';
}
return Redirect::to('/admin/trips/' . $data['trip_id'] . '/sightings')->withErrors($validator);
} else {
try {
$sighting = new Sighting();
$sighting->fill($data)->save();
$flashMessage = 'Added sighting.';
} catch (Exception $e) {
$errorMessage = $e->getMessage();
// most likely error is duplicate sighting; UNIQUE constraint violation
if (stripos($errorMessage, 'duplicate entry') > 0) {
$errorMessage = 'Duplicate sighting.';
}
$flashMessage = $errorMessage;
}
return Redirect::to('/admin/trips/' . $data['trip_id'] . '/sightings')->with('flashMessage', $flashMessage);
}
}
示例14: doLogin
public function doLogin()
{
// process the form
// validate the info, create rules for the inputs
$rules = array('fname' => 'required', 'mobile' => 'required|integer');
// 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::to('login')->withErrors($validator)->withInput(Input::except('mobile'));
// send back the input (not the password) so that we can repopulate the form
} else {
$plaintext_pwd = Input::get('mobile');
// create our user data for the authentication
$userdata = array('fname' => Input::get('fname'), 'password' => $plaintext_pwd);
// attempt to do the login
// 'remember me' activated
if (Auth::attempt($userdata, true)) {
// 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::route('dashboard');
//return true;
} else {
// validation not successful, send back to form
return Redirect::to('login')->withInput(Input::except('mobile'));
//return false;
}
}
}
示例15: getIndex
public function getIndex()
{
$data['solicitudes'] = Solicitud::eagerLoad()->aplicarFiltro(Input::except(['asignar', 'solo_asignadas', 'page', 'cerrar', 'anulando', '']))->ordenar();
if (Input::has('asignar')) {
$data['campo'] = Input::get('asignar');
$data['solicitud'] = new Solicitud();
if ($data['campo'] == 'usuario') {
$usuario = Usuario::getLogged();
$data['solicitudes']->whereDepartamentoId($usuario->departamento_id);
$data['analistas'] = $usuario->getCompaneros();
}
} else {
if (Input::has('anulando')) {
$data['anulando'] = true;
} else {
if (Input::has('cerrar')) {
$data['cerrar'] = true;
} else {
if (Input::has('solo_asignadas')) {
$data['solo_asignadas'] = true;
}
}
}
}
$data['solicitudes'] = $data['solicitudes']->paginate(5);
//se usa para el helper de busqueda
$data['persona'] = new Persona();
$data['solicitud'] = new Solicitud();
$data['presupuesto'] = new Presupuesto();
$data['requerimiento'] = new Requerimiento();
return View::make('solicitudes.index', $data);
}