app/Http/Controllers/modelsController.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(ModelDataRequest $request)
    {
        try{
            $Model=new Models;
            $Model->modelName=$request->get('modelName');
            $Model->transmissionType=$request->get('transmissionType');
            $Model->fuelType=$request->get('fuelType');
            $Model->engineCapacity=$request->get('engineCapacity');
            $Model->countryMade=$request->get('country');
            $Model->admin_id=$request->get('admin_id');
            $Model->brandName=$request->get('brandName');
            $Model->yearOfManufacture=$request->get('year');
            $Model->save();
            \Session::flash('flash_message','Added new Model.'); 
            return redirect()->back();
        }
        catch (\Illuminate\Database\QueryException $ex){
            dd($ex->getMessage());
        }
    }
public function store ( ModelDataRequest $ request ) { try { $ Model = new Models ; $ Model -> modelName = $ request -> get ( 'modelName' ) ; $ Model -> transmissionType = $ request -> get ( 'transmissionType' ) ; $ Model -> fuelType = $ request -> get ( 'fuelType' ) ; $ Model -> engineCapacity = $ request -> get ( 'engineCapacity' ) ; $ Model -> countryMade = $ request -> get ( 'country' ) ; $ Model -> admin_id = $ request -> get ( 'admin_id' ) ; $ Model -> brandName = $ request -> get ( 'brandName' ) ; $ Model -> yearOfManufacture = $ request -> get ( 'year' ) ; $ Model -> save ( ) ; \ Session :: flash ( 'flash_message' , 'Added new Model.' ) ; return redirect ( ) -> back ( ) ; } catch ( \ Illuminate \ Database \ QueryException $ ex ) { dd ( $ ex -> getMessage ( ) ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .
//<--FLASH MESSAGE