コード例 #1
0
 /**
  * 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'));
 }
コード例 #2
0
 /**
  * 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'])]);
 }
コード例 #3
0
 /**
  * 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');
 }