app/Http/Controllers/UsersController.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(Request $request)
    {
        $user = new Users();
        $username  = $request->username;
        $password  = $request->password;
        $userType  = $request->userType;
        $clientID  = $request->userClientID;
        $status    = $request->userStatusCode;
        $userGroup = $request->userGroup;
        $result = $user->addUser($username, $password, $userType, $clientID, $status, $userGroup);
        if($result) {
             \Session::flash('flash_message','New user created successfully.');
        } else {
             \Session::flash('error_message','Error in handling request.');
        }
        return redirect('users');
    }
public function store ( Request $ request ) { $ user = new Users ( ) ; $ username = $ request -> username ; $ password = $ request -> password ; $ userType = $ request -> userType ; $ clientID = $ request -> userClientID ; $ status = $ request -> userStatusCode ; $ userGroup = $ request -> userGroup ; $ result = $ user -> addUser ( $ username , $ password , $ userType , $ clientID , $ status , $ userGroup ) ; if ( $ result ) { \ Session :: flash ( 'flash_message' , 'New user created successfully.' ) ; } else { \ Session :: flash ( 'error_message' , 'Error in handling request.' ) ; } return redirect ( 'users' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// instantiate model class // get params from post request // call function from model to add user to database // redirect to index after save