/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { $users = User::all(); $administrators = Administrator::Search($request->name)->paginate(10); return view('administrator.index', compact('administrators', 'users')); }
/** * 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'])]); }
/** * Store a newly created resource in storage. * * @param \Veterinaria\Http\Requests\UserCreateRequest $request * @return \Illuminate\Http\Response */ public function store(UserCreateRequest $request) { User::Create(['name' => $request['name'], 'email' => $request['email'], 'password' => $request['password']]); Session::flash('message', 'Usuario creado correctamente'); return Redirect::to('/user'); }