/** * Run the database seeds. * * @return void */ public function run() { $admin = User::create(['name' => 'admin', 'email' => '*****@*****.**', 'password' => bcrypt('123123'), 'role' => 'administrador']); $admin->save(); $encargado = User::create(['name' => 'encargado', 'email' => '*****@*****.**', 'password' => bcrypt('123123'), 'role' => 'encargado']); $encargado->save(); $socio = User::create(['name' => 'socio', 'email' => '*****@*****.**', 'password' => bcrypt('123123'), 'role' => 'socio']); $socio->save(); $cliente = User::create(['name' => 'cliente', 'email' => '*****@*****.**', 'password' => bcrypt('123123'), 'role' => 'cliente']); $cliente->save(); }
public static function getStatus($reserva) { $user = User::findOrFail($reserva->user_id); $aux = $user->reservas()->where('fecha_inicio', '=', $reserva->fecha_inicio)->get(); if ($aux->count() > 0) { return $aux->first()->estado; } else { if (Reserva::available($reserva)) { return 'disponible'; } else { return 'no disponible'; } } }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }
public function reservarLotes($user_id) { $user = User::findOrFail($user_id); return view('encargado.usuarios.reservarLotes')->with('user', $user); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $user = User::find($id); $user->deleteUser(); $users = User::all(); Session::flash('message-success', 'Usuario eliminado correctamente'); return Redirect::route('empleado.usuarios')->with('users', $users); }