app/Http/Controllers/__Old__/__UserController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(CreateUserRequest $request)
    {
        $input = $request->all();
            $input['password'] = Hash::make($input['password']);
            $user = User::create($input);
            foreach ($request->input('roles') as $key => $value) {
                $user->attachRole($value);
            }
        Session::flash('success','User created successfully');
        return redirect()->route('users.index');
    }
public function store ( CreateUserRequest $ request ) { $ input = $ request -> all ( ) ; $ input [ 'password' ] = Hash :: make ( $ input [ 'password' ] ) ; $ user = User :: create ( $ input ) ; foreach ( $ request -> input ( 'roles' ) as $ key => $ value ) { $ user -> attachRole ( $ value ) ; } Session :: flash ( 'success' , 'User created successfully' ) ; return redirect ( ) -> route ( 'users.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// create new row in profile table for this user // $profile = new Profile; //     $profile->user_id = $user->id; // $profile->save();