src/Http/Controllers/UsersController.php
public function store(UserRequest $request)
    {
        $user = new User;
        $request['password'] = bcrypt($request->get('password'));
        $user = $user->create($request->only($user->getFillable()));
        $user->roles()->sync(collect($request->get('role'))->all());

        return redirect()->route('user.manager.index');
    }
public function store(UserRequest $request)
    {
        $user = new User;
        $request['password'] = bcrypt($request->get('password'));
        $user = $user->create($request->only($user->getFillable()));
        $user->roles()->sync(collect($request->get('role'))->all());

        return redirect()->route('user.manager.index');
    }
public function store ( UserRequest $ request ) { $ user = new User ; $ request [ 'password' ] = bcrypt ( $ request -> get ( 'password' ) ) ; $ user = $ user -> create ( $ request -> only ( $ user -> getFillable ( ) ) ) ; $ user -> roles ( ) -> sync ( collect ( $ request -> get ( 'role' ) ) -> all ( ) ) ; return redirect ( ) -> route ( 'user.manager.index' ) ; }
Store a newly created resource in storage.

@param  UserRequest  $request
@return Response
Store a newly created resource in storage .