app/Http/Controllers/StatusCodesController.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)
    {
        $statusCodes = new StatusCodes();
        $code = $request->code;
        $description = $request->description;
        $result = $statusCodes->addStatusCode($code, $description);
        if($result) {
             \Session::flash('flash_message','New Status Code created successfully.');
        } else {
             \Session::flash('error_message','Error in handling request.');
        }
        return redirect('status_codes');
    }
public function store ( Request $ request ) { $ statusCodes = new StatusCodes ( ) ; $ code = $ request -> code ; $ description = $ request -> description ; $ result = $ statusCodes -> addStatusCode ( $ code , $ description ) ; if ( $ result ) { \ Session :: flash ( 'flash_message' , 'New Status Code created successfully.' ) ; } else { \ Session :: flash ( 'error_message' , 'Error in handling request.' ) ; } return redirect ( 'status_codes' ) ; }
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 statusCodes to database // redirect to index after save