make() public static méthode

Hash the given value.
public static make ( string $value, array $options = [] ) : string
$value string
$options array
Résultat string
 public function createParent()
 {
     $input = Input::all();
     if (Input::hasFile('profilepic')) {
         $input['profilepic'] = $this->filestore(Input::file('profilepic'));
     }
     $input['dob'] = date('Y-m-d H:i:s', strtotime(Input::get('dob')));
     $input['collegeid'] = Session::get('user')->collegeid;
     $input['collegename'] = Admin::where('collegeid', '=', Session::get('user')->collegeid)->first()->collegename;
     //$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;
     $removed = array('_token', 'password', 'cpassword');
     foreach ($removed as $k) {
         unset($input[$k]);
     }
     Parent::saveFormData($input);
     return $input;
 }
 public function run()
 {
     User::create(array('group_id' => 1, 'name' => 'Разработчик', 'surname' => '', 'email' => '*****@*****.**', 'active' => 1, 'password' => Hash::make('grapheme1234'), 'photo' => '', 'thumbnail' => '', 'temporary_code' => '', 'code_life' => 0, 'remember_token' => 'Ycr4p62EPv3x3UWabeo3NpiSdJmI7hT3E460C5eTuiFKp1Vbjg6WL2M2bmPv'));
     DB::table('sessions')->insert(array(array('id' => '80b1264be73168dfa026345d79abc86a1d29660c', 'payload' => 'YTo2OntzOjY6Il90b2tlbiI7czo0MDoiQXVsQ0M1Y0dhQTJMV2lKWVF4VTVlUkRtZ0s0NE5wdFRHeXh2eEdjMSI7czo2OiJsb2NhbGUiO3M6MjoicnUiO3M6MjI6IlBIUERFQlVHQkFSX1NUQUNLX0RBVEEiO2E6MDp7fXM6NToiZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czozODoibG9naW5fODJlNWQyYzU2YmRkMDgxMTMxOGYwY2YwNzhiNzhiZmMiO2k6MTtzOjk6Il9zZjJfbWV0YSI7YTozOntzOjE6InUiO2k6MTQxNjM5OTU3MztzOjE6ImMiO2k6MTQxNjM5Mzg3ODtzOjE6ImwiO3M6MToiMCI7fX0=', 'last_activity' => time())));
     User::create(array('group_id' => 2, 'name' => 'Администратор', 'surname' => '', 'email' => '*****@*****.**', 'active' => 1, 'password' => Hash::make('grapheme1234'), 'photo' => '', 'thumbnail' => '', 'temporary_code' => '', 'code_life' => 0));
     User::create(array('group_id' => 3, 'name' => 'Модератор', 'surname' => '', 'email' => '*****@*****.**', 'active' => 1, 'password' => Hash::make('grapheme1234'), 'photo' => '', 'thumbnail' => '', 'temporary_code' => '', 'code_life' => 0));
 }
 /**
  * This function create employee
  * when data is posted from 
  * /admin/employee/create
  */
 public function postCreate()
 {
     // Check validation
     $validator = Validator::make(Input::all(), Employee::$rulesForCreate, Employee::$messages);
     // If failed then redirect to employee-create-get route with
     // validation error and input old
     if ($validator->fails()) {
         return Redirect::route('employee-create-get')->withErrors($validator)->withInput();
     }
     // If validation is not failed then create employee
     $employee = Employee::create(array('first_name' => Input::get('first_name'), 'last_name' => Input::get('last_name'), 'age' => Input::get('age'), 'gender' => Input::get('gender'), 'DOB' => DateFormat::store(Input::get('DOB')), 'present_address' => Input::get('present_address'), 'permanent_address' => Input::get('permanent_address'), 'city' => Input::get('city'), 'state' => Input::get('state'), 'country' => Input::get('country'), 'mobile_no' => Input::get('mobile_no'), 'email' => Input::get('email'), 'created_by' => Session::get('username')));
     // Also create user account for the employee
     $user = User::create(array('details_id' => $employee->id, 'username' => Input::get('username'), 'email' => $employee->email, 'user_level' => Input::get('userlevel'), 'active' => 0));
     // generate random code and password
     $password = str_random(10);
     $code = str_random(60);
     $newHashPassword = Hash::make($password);
     // Save new password and code
     $user->password_tmp = $newHashPassword;
     $user->activation_code = $code;
     if ($user->save()) {
         // Send email to the employee.
         // This email contains username,password,activation link
         Mail::send('emails.auth.activation', array('first_name' => $employee->first_name, 'last_name' => $employee->last_name, 'username' => $user->username, 'password' => $password, 'activation_link' => URL::route('activation-get', $code)), function ($message) use($user) {
             $message->to($user->email, $user->username)->subject('Confirm Activation');
         });
     }
     return View::make('adminArea.employee.create')->with('success', 'Activation link has been sent successfully');
 }
Exemple #4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     for ($i = 0; $i < 40; $i++) {
         \DB::table('usuarios')->insert(array('snombre' => $faker->firstname, 'sapellido' => $faker->lastname, 'scontrasena' => \Hash::make('12345'), 'scorreo' => $faker->unique()->email, 'badministra' => 0));
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create('pt_BR');
     for ($i = 0; $i < 10; $i++) {
         DB::table('users')->insert(array('name' => $faker->name, 'telefone' => $faker->cellphone, 'email' => $faker->unique()->email, 'password' => \Hash::make('123456'), 'role' => 'user'));
     }
 }
Exemple #6
0
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     // disable foreign key constraints
     // Reset table
     DB::table('users')->truncate();
     // Reset table
     DB::table('user_details')->truncate();
     $admin_account = Config::get('cms::settings.admin_account');
     $admin_settings = array('role_id' => 1, 'lang' => Config::get('cms::settings.language'), 'editor' => 0, 'is_active' => 1);
     $admin_user = array_merge($admin_account, $admin_settings);
     $admin_user['password'] = Hash::make($admin_user['password']);
     $admin = User::create($admin_user);
     UserDetail::create(array('user_id' => $admin->id));
     // RANDOM 50 USERS
     // Faker data
     $faker = Faker\Factory::create();
     for ($i = 1; $i <= 50; $i++) {
         $user_settings = array('role_id' => 4, 'username' => $faker->username, 'email' => $faker->email, 'password' => Hash::make($faker->word), 'lang' => Config::get('cms::settings.language'), 'editor' => 0, 'is_active' => 1);
         $user = User::create($user_settings);
         $details = array('firstname' => $faker->firstname, 'lastname' => $faker->lastname, 'gender' => $faker->randomElement(array('m', 'f')), 'city' => $faker->city, 'bio' => $faker->text, 'birth_date' => $faker->date('Y-m-d', '-18 years'));
         $user->details()->create($details);
     }
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
     // enable foreign key constraints
 }
Exemple #7
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     /*for ($i = 1; $i <= 2; $i++) {
           $this->command->info('User '.$i);
       
           DB::table('users')->insert(array ( 
               "name"      => $faker->userName, 
               "email"     => $faker->unique()->safeEmail,
               //"name"      => 'embajada77', 
               //"email"     => '*****@*****.**',
               "password"  => Hash::make('1234')
           ));
       }*/
     $users_array = array();
     $tope = 5518;
     $cronom = new cronometro();
     $password = Hash::make('1234');
     for ($i = 1; $i <= $tope; $i++) {
         $users_array[$i] = array("name" => $faker->userName, "email" => $faker->unique()->safeEmail, "password" => $password);
         $prcnt = ROUND($i * 100 / $tope, 2);
         $string_time = $cronom->getTiempoTranscurrido() . ' ' . $cronom->EstimarTiempoRestante($prcnt);
         $this->command->info($string_time . ' ' . $prcnt . '% User ' . $i . '/' . $tope);
     }
     DB::table('users')->insert($users_array);
 }
 public function register()
 {
     $mobile = Input::get('mobile');
     $email = Input::get('email');
     $password = Input::get('password');
     //对密码进行hash加密
     $password = Hash::make($password);
     $user = new User();
     $user->password = $password;
     $user->last_login_time = time();
     $user->last_login_ip = $this->getIP();
     $user->lock = 0;
     $user->user_type = 'business';
     $user->add_time = time();
     if ($user->save()) {
         $uid = $user->id;
     } else {
         echo "user base Error";
         exit;
     }
     $Buser = new BUser();
     $Buser->uid = $uid;
     $Buser->email = $email;
     $Buser->mobile = $mobile;
     $Buser->email_passed = 0;
     $Buser->mobile_passed = 1;
     if ($Buser->save()) {
         echo "ok";
     }
 }
Exemple #9
0
function encriptar_contra($contra = null)
{
    if ($contra == null) {
        $contra = str_random(10);
    }
    return \Hash::make($contra);
}
 public function postRegister()
 {
     $validationRules = array('email' => 'required|email|unique:users', 'password' => 'required|min:8|confirmed', 'type' => 'required');
     $formValidator = Validator::make(Input::all(), $validationRules);
     if ($formValidator->passes()) {
         // creatting new user
         $createUser = new User();
         $createUser->email = Input::get('email');
         $createUser->type = Input::get('type');
         $createUser->password = Hash::make(Input::get('password'));
         $createUser->status = 'OFF';
         $createUser->save();
         // checking to create if user is patient or physician
         if ($createUser->type == 'PHYSICIAN') {
             $createPhysisician = new Physician();
             $createPhysisician->user_id = $createUser->id;
             $createPhysisician->save();
         }
         if ($createUser->type == 'PATIENT') {
             $createPatient = new Patient();
             $createPatient->user_id = $createUser->id;
             $createPatient->save();
         }
         return Redirect::to('user/login')->with('success', ' Account created, please login');
     } else {
         return Redirect::back()->withInput()->withErrors($formValidator);
     }
 }
Exemple #11
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     /*
     * Schema::create('users', function(Blueprint $table)
             {
        $table->increments('id');
        $table->string('profesion')->nullable();
        $table->string('especialidad');
        $table->string('first_name');
        $table->string('father_last_name');
        $table->string('mother_last_name')->nullable();
        $table->string('fuerza')->nullable();
        $table->string('ci')->unique();
        $table->string('exp');
        $table->string('email')->unique();
        $table->date('birthday');
        $table->string('password', 60);
        $table->enum('type', ['Admin', 'Cursante', 'Tutor']);
        $table->string('grado')->nullable();
        $table->rememberToken();
        $table->timestamps();
             });
     */
     \DB::table('users')->insert(array('first_name' => 'Admin', 'father_last_name' => ' ', 'mother_last_name' => ' ', 'ci' => '000000', 'especialidad' => 'Admin', 'exp' => 'LP', 'type' => 'Admin', 'email' => '*****@*****.**', 'birthday' => '1999-01-01', 'password' => \Hash::make('EAEN2015')));
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $ip = '10.168.56.1';
     DB::table('users')->delete();
     $users = [['username' => 'admin', 'email' => '*****@*****.**', 'password' => Hash::make('test'), 'role' => 0, 'ip' => $ip]];
     DB::table('users')->insert($users);
 }
 public function run()
 {
     //User::truncate();
     DB::Table('users')->delete();
     User::create(['email' => '*****@*****.**', 'password' => Hash::make('password'), 'name' => 'craig']);
     User::create(['email' => '*****@*****.**', 'password' => Hash::make('password'), 'name' => 'david']);
 }
Exemple #14
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $application = Application::create(['name' => 'RYZR CMS']);
     $application_url = ApplicationUrl::create(['application_id' => $application->id, 'domain' => 'ryzr-cms.dev', 'folder' => '']);
     $user = User::create(['name' => 'admin', 'email' => '*****@*****.**', 'password' => \Hash::make('password')]);
     $role_global_admin = Role::create(['name' => 'global_admin', 'display_name' => 'Global Administrator', 'description' => 'User is the administrator of all applications', 'application_id' => $application->id]);
     $role_admin = Role::create(['name' => 'admin', 'display_name' => 'Administrator', 'description' => 'User is the administrator of a given application', 'application_id' => $application->id]);
     $role_user = Role::create(['name' => 'user', 'display_name' => 'User', 'description' => 'Standard user (authenticated)', 'application_id' => $application->id]);
     $role_guest = Role::create(['name' => 'guest', 'display_name' => 'Guest', 'description' => 'Unauthenticated user', 'application_id' => $application->id]);
     $basic_admin = Permission::create(['name' => 'basic-admin', 'display_name' => 'Basic Admin', 'description' => 'User can access basic admin features', 'section' => 'admin', 'application_id' => $application->id]);
     $manage_own_permissions = Permission::create(['name' => 'manage-own-permissions', 'display_name' => 'Manage own permissions', 'description' => 'User can manage own permissions', 'section' => 'admin', 'application_id' => $application->id]);
     $manage_permissions = Permission::create(['name' => 'manage-permissions', 'display_name' => 'Manage permissions', 'description' => 'User can manage permissions', 'section' => 'admin', 'application_id' => $application->id]);
     $manage_groups = Permission::create(['name' => 'manage-roles', 'display_name' => 'Manage roles', 'description' => 'User can manage roles', 'section' => 'admin', 'application_id' => $application->id]);
     $manage_users = Permission::create(['name' => 'manage-users', 'display_name' => 'Manage users', 'description' => 'User can manage users', 'section' => 'admin', 'application_id' => $application->id]);
     $user->applications()->attach($application);
     $role_global_admin->attachPermission($basic_admin);
     $role_global_admin->attachPermission($manage_own_permissions);
     $role_global_admin->attachPermission($manage_permissions);
     $role_global_admin->attachPermission($manage_groups);
     $role_global_admin->attachPermission($manage_users);
     $role_admin->attachPermission($basic_admin);
     $role_admin->attachPermission($manage_own_permissions);
     $role_admin->attachPermission($manage_permissions);
     $role_admin->attachPermission($manage_groups);
     $role_admin->attachPermission($manage_users);
     $user->attachRole($role_global_admin);
 }
 /**
  * Return captcha image
  * @param number $maxChar
  */
 public function generate($maxChar = 4)
 {
     // $characters = '23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
     $characters = 'ABCDEFGHKMNPQRST';
     $captchaText = '';
     for ($i = 0; $i < $maxChar; $i++) {
         $captchaText .= $characters[rand(0, strlen($characters) - 1)];
     }
     strtoupper(substr(md5(microtime()), 0, 7));
     \Session::put('captchaHash', \Hash::make($captchaText));
     $image = imagecreate(30 * $maxChar, 35);
     $background = imagecolorallocatealpha($image, 255, 255, 255, 1);
     $textColor = imagecolorallocatealpha($image, 206, 33, 39, 1);
     $x = 5;
     $y = 20;
     $angle = 0;
     for ($i = 0; $i < 7; $i++) {
         $fontSize = 16;
         $text = substr($captchaText, $i, 1);
         imagettftext($image, $fontSize, $angle, $x, $y, $textColor, public_path('/fonts/LibreBaskerville/librebaskerville-regular.ttf'), $text);
         $x = $x + 17 + mt_rand(1, 10);
         $y = mt_rand(18, 25);
         $angle = mt_rand(0, 20);
     }
     header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
     header('Pragma: no-cache');
     header('Content-type: image/jpeg');
     imagejpeg($image, null, 100);
     imagedestroy($image);
 }
Exemple #16
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $input = Input::only('email', 'username', 'password');
     $rules = array('email' => 'required|email|unique:users,email,' . Auth::user()->id . ',id,deleted_at,NULL,status,' . Auth::user()->status . '');
     if ($input['password']) {
         $rules['password'] = '******';
     }
     $v = Validator::make($input, $rules);
     if ($v->fails()) {
         return Output::push(array('path' => 'user', 'errors' => $v, 'input' => TRUE));
     }
     if ($input['password'] && $id && Auth::user()->id == $id) {
         $user = user::find($id);
         //$user->username = $input['username'];
         $user->email = $input['email'];
         if ($input['password']) {
             $user->password = Hash::make($input['password']);
             Event::fire('logger', array(array('account_password_update', array('id' => $id, 'username' => $user->username), 2)));
         }
         $user->save();
         return Output::push(array('path' => 'user', 'errors' => 'Change Password Successfully', 'messages' => array('success', _('User data has been saved')), 'input' => TRUE));
     } else {
         return Output::push(array('path' => 'user', 'errors' => 'Unable to update user', 'messages' => array('fail', _('Unable to update user')), 'input' => TRUE));
     }
 }
Exemple #17
0
 public function prepareData($data = [])
 {
     if (isset($data['password'])) {
         $data['password'] = \Hash::make($data['password']);
     }
     return $data;
 }
Exemple #18
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // ADMIN USER (DIMIZAS)
     User::create(array('name' => 'Christos', 'lastname' => 'Dimizas', 'email' => '*****@*****.**', 'password' => Hash::make('1234qwer'), 'user_role_id' => 1, 'user_subrole_id' => null, 'activation_status' => 1, 'is_deactivated' => 0));
     // ADMIN USER (IASONIDIS)
     User::create(array('name' => 'Theodoros', 'lastname' => 'Iasonidis', 'email' => '*****@*****.**', 'password' => Hash::make('!1234qwer!'), 'user_role_id' => 1, 'user_subrole_id' => null, 'activation_status' => 1, 'is_deactivated' => 0));
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, $faker->numberBetween(5, 10)) as $index) {
         Organisation::create(['name' => $faker->company, 'lrsUser' => $faker->userName, 'lrsPass' => Hash::make('password')]);
     }
 }
 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');
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function save()
 {
     $rules = ['firstname' => 'required', 'lastname' => 'required', 'login' => 'required', 'address' => 'required', 'cpassword' => 'required', 'npassword' => 'required', 'cnpassword' => 'required'];
     $validator = \Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::to('/settings')->withinput(Input::all())->withErrors($validator);
     } else {
         if (Input::get('npassword') == Input::get('cnpassword')) {
             // $u = User::select('*')->where('password',Hash::make(Input::get('cpassword')))->first();
             //return Hash::make(Input::get('cpassword'));
             //if(count($u)>0) {
             $user = User::find(Input::get('id'));
             $user->firstname = Input::get('firstname');
             $user->lastname = Input::get('lastname');
             //  $user->login = Input::get('login');
             $user->address = Input::get('address');
             // $user->email = Input::get('email');
             $user->password = Hash::make(Input::get('npassword'));
             $user->save();
             return Redirect::to('/settings')->with('success', 'Settings is changed please relogin the site.');
             /*}
               else
               {
                   $errorMessages = new Illuminate\Support\MessageBag;
                   $errorMessages->add('notmatch', 'Current Password did not match!');
                   return Redirect::to('/settings')->withErrors($errorMessages);
               }*/
         } else {
             $errorMessages = new Illuminate\Support\MessageBag();
             $errorMessages->add('notmatch', 'New Password and confirm password did not match!');
             return Redirect::to('/settings')->withErrors($errorMessages);
         }
     }
 }
 public function postRegister()
 {
     $inputs = Input::all();
     $validator_owner = Validator::make($inputs, OwnerHotel::$rules);
     $validator_hotel = Validator::make($inputs, \App\Hotels::$roles);
     try {
         // create user owner
         $data = ['sure_name' => $inputs['sure_name'], 'role_id' => $inputs['role'], 'first_name' => $inputs['first_name'], 'last_name' => $inputs['last_name'], 'email' => $inputs['email'], 'password' => $inputs['password'] = Hash::make($inputs['password'])];
         $success_owner = OwnerHotel::create($data);
         if (!$success_owner) {
             throw new Exception('Can not create User owner !');
         }
         // create new hotel
         $hotelData = ['name_local' => $inputs['name_local'], 'owner_id' => $success_owner->id, 'num_of_rooms' => $inputs['num_of_rooms'], 'main_phone' => $inputs['main_phone'], 'hotel_website' => $inputs['hotel_website'], 'num_of_booking_month' => $inputs['num_of_booking_month'], 'license_number' => $inputs['license_number'], 'property_english' => $inputs['property_english']];
         $success_hotel = \App\Hotels::create($hotelData);
         if ($validator_owner->fails() || $validator_hotel->fails()) {
             $errors = $validator_hotel->messages()->merge($validator_owner->messages());
             return Redirect::back()->withErrors($errors)->withInput([$hotelData, $data]);
         }
         if (!$success_hotel) {
             throw new Exception('Can not create Hotel');
         }
         return Redirect::to('account/login')->with('alert-success', 'Sign up successful, Please check your email.');
     } catch (Exception $e) {
         return Redirect::back()->withInput()->withError('Can not create !');
     }
 }
 public function login($username = null, $password = null, $remember = false)
 {
     if (!$username && !$password && $this->exists()) {
         Session::put($this->_sessionName, $this->data()->id);
     } else {
         $user = $this->find($username);
         if ($user) {
             if ($this->data()->password === Hash::make($password, $this->data()->salt)) {
                 Session::put($this->_sessionName, $this->data()->id);
                 if ($remember) {
                     $hash = Hash::unique();
                     $hashCheck = $this->_db->get('users_session', array('user_id', '=', $this->data()->id));
                     if (!$hashCheck->count()) {
                         $this->_db->insert('users_session', array('user_id' => $this->data()->id, 'hash' => $hash));
                     } else {
                         $hash = $hashCheck->first()->hash;
                     }
                     Cookie::put($this->_cookieName, $hash, Config::get('remember.cookie_expiry'));
                 }
                 return true;
             }
         }
     }
     return false;
 }
 /**
  * Create a new event instance.
  *
  * @return void
  */
 public function __construct($EcNa, $typ, $eml, $pass, $nomresp, $fix, $port, $adres, $ville, $pays)
 {
     $this->ecoleNom = $EcNa;
     $this->type = $typ;
     $this->email = $eml;
     $this->password = $pass;
     $this->nomResponsable = $nomresp;
     $this->fix = $fix;
     $this->portab = $port;
     $this->adresse = $adres;
     $this->ville = $ville;
     $this->pays = $pays;
     $user = new User();
     $user->name = $this->ecoleNom;
     $user->type = $this->type;
     $user->email = $this->email;
     $user->password = \Hash::make($this->password);
     $user->nom_responsable = $this->nomResponsable;
     $user->tel_fixe = $this->fix;
     $user->tel_portable = $this->portab;
     $user->adresse = $this->adresse;
     $user->ville = $this->ville;
     $user->pays = $this->pays;
     $user->save();
     if ($user) {
         $info = ['nom_resp' => $this->nomResponsable, 'nom_ecole' => $this->ecoleNom, 'email' => $this->email, 'pass' => $this->password];
         Mail::queue('emails.school', $info, function ($message) {
             $message->to($this->email, 'ok')->from('*****@*****.**')->subject('Bienvenue  !');
         });
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     DB::table('customers')->delete();
     $customers = array(['id' => 1, 'username' => 'admin', 'password' => Hash::make('pwd'), 'email' => '*****@*****.**', 'mobile' => '+9593726346', 'display_name' => 'Administrator', 'device_token' => 'c9ExXhiSxB4:APA91bEFaNZw1WQ6PsvwFDrhs56kdPlXHOGzMf5Xyho1goQt69aHf2ZlysgbZNBfo6hSb__EbD930k2j0JMy4sYuyFTuAo4M-ZB0UbejSWyNBGBIU3V5jvacNut1aNE5Sknys-hlNu8x', 'platform' => 'A', 'status' => 1, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')], ['id' => 2, 'username' => 'minthura', 'password' => Hash::make('pwd'), 'email' => '*****@*****.**', 'mobile' => '+9593726346', 'display_name' => 'Min Thura', 'device_token' => 'c9ExXhiSxB4:APA91bEFaNZw1WQ6PsvwFDrhs56kdPlXHOGzMf5Xyho1goQt69aHf2ZlysgbZNBfo6hSb__EbD930k2j0JMy4sYuyFTuAo4M-ZB0UbejSWyNBGBIU3V5jvacNut1aNE5Sknys-hlNu8x', 'platform' => 'A', 'status' => 1, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')], ['id' => 3, 'username' => 'arrtee', 'password' => Hash::make('pwd'), 'email' => '*****@*****.**', 'mobile' => '+959334344', 'display_name' => 'Thet Naing Oo', 'device_token' => 'c9ExXhiSxB4:APA91bEFaNZw1WQ6PsvwFDrhs56kdPlXHOGzMf5Xyho1goQt69aHf2ZlysgbZNBfo6hSb__EbD930k2j0JMy4sYuyFTuAo4M-ZB0UbejSWyNBGBIU3V5jvacNut1aNE5Sknys-hlNu8x', 'platform' => 'A', 'status' => 1, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')]);
     DB::table('customers')->insert($customers);
 }
 public function run()
 {
     $now = date('Y-m-d H:i:s');
     //DB::table('users')->delete();
     $users = [['group_id' => 5, 'username' => 'nick', 'fullname' => 'Nicholas Law', 'active' => 1, 'email' => '*****@*****.**', 'email_verified' => 1, 'password' => Hash::make('nl511988'), 'ip_address' => Request::getClientIp(), 'gender' => 'male', 'country' => 'Australia', 'created_at' => $now, 'updated_at' => $now], ['group_id' => 5, 'username' => 'demo', 'fullname' => 'Demo Account', 'active' => 1, 'email' => '*****@*****.**', 'email_verified' => 1, 'password' => Hash::make('demo'), 'ip_address' => Request::getClientIp(), 'gender' => 'male', 'country' => 'United States', 'created_at' => $now, 'updated_at' => $now], ['group_id' => 5, 'username' => 'test', 'fullname' => 'John Doe', 'active' => 1, 'email' => '*****@*****.**', 'email_verified' => 1, 'password' => Hash::make('test'), 'ip_address' => Request::getClientIp(), 'gender' => 'male', 'country' => 'United States', 'created_at' => $now, 'updated_at' => $now]];
     DB::table('users')->insert($users);
 }
 public function run()
 {
     DB::table('users')->truncate();
     factory('CodeCommerce\\User')->create(['name' => "Houston", 'email' => '*****@*****.**', 'password' => Hash::make('123456'), 'is_admin' => true, 'endereco' => 'R. Canadá', 'numero' => 73, 'bairro' => 'Jardim Naltilus', 'cidade' => 'Cabo Frio', 'uf' => 'RJ', 'cep' => '28909-170']);
     //usuario  padrao
     factory('CodeCommerce\\User', 9)->create();
 }
Exemple #28
0
 public function postNew()
 {
     $validation = new Validators\SeatUserRegisterValidator();
     if ($validation->passes()) {
         // Let's register a user.
         $user = new \User();
         $user->email = Input::get('email');
         $user->username = Input::get('username');
         $user->password = Hash::make(Input::get('password'));
         $user->tsid = Input::get('tsid');
         $user->activation_code = str_random(24);
         $user->activated = 1;
         $user->save();
         // Prepare data to be sent along with the email. These
         // are accessed by their keys in the email template
         $data = array('activation_code' => $user->activation_code);
         // Send the email with the activation link
         Mail::send('emails.auth.register', $data, function ($message) {
             $message->to(Input::get('email'), 'New SeAT User')->subject('SeAT Account Confirmation');
         });
         // And were done. Redirect to the login again
         return Redirect::action('SessionController@getSignIn')->with('success', 'Successfully registered a new account. Please check your email for the activation link.');
     } else {
         return Redirect::back()->withInput()->withErrors($validation->errors);
     }
 }
Exemple #29
0
 public static function password_update($password, $user = NULL)
 {
     if ($user or $user = self::find(Auth::user()->id)) {
         $user->pass = Hash::make($password);
         return $user->save();
     }
 }
Exemple #30
-1
 public function run()
 {
     DB::table('users')->delete();
     User::create(array('user_id' => 1, 'name' => 'Wade', 'email' => '*****@*****.**', 'password' => Hash::make('a1!')));
     User::create(array('user_id' => 2, 'name' => 'Ryan', 'email' => '*****@*****.**', 'password' => Hash::make('b2@')));
     User::create(array('user_id' => 3, 'name' => 'Mark', 'email' => '*****@*****.**', 'password' => Hash::make('c3#')));
 }