app/Http/Controllers/categoriesController.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(CategoryDataRequest $request)
    {
        try {
            $Category = new Categories;
            $Category->categoryName = $request->get('categoryName');
            $Category->admin_id = $request->get('admin_id');
            $Category->save();
            \Session::flash('flash_message', 'Added new Category.'); 
            return redirect()->back();
        } catch (\Illuminate\Database\QueryException $ex) {
            dd($ex->getMessage());
        }
    }
public function store ( CategoryDataRequest $ request ) { try { $ Category = new Categories ; $ Category -> categoryName = $ request -> get ( 'categoryName' ) ; $ Category -> admin_id = $ request -> get ( 'admin_id' ) ; $ Category -> save ( ) ; \ Session :: flash ( 'flash_message' , 'Added new Category.' ) ; 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