app/Http/Controllers/ProductController.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)
    {
        $product = new Product();
        try {
            $product::create($request->all());
            return redirect('/product/create')
                ->with('status', trans('product.create_product_success'))
                ->with('status_box', 'success');
        }catch (\Exception $e) {
            return redirect('/product/create')
                ->with('status', trans('product.error_create_product'))
                ->with('status_box', 'danger');
        }
    }
public function store ( Request $ request ) { $ product = new Product ( ) ; try { $ product :: create ( $ request -> all ( ) ) ; return redirect ( '/product/create' ) -> with ( 'status' , trans ( 'product.create_product_success' ) ) -> with ( 'status_box' , 'success' ) ; } catch ( \ Exception $ e ) { return redirect ( '/product/create' ) -> with ( 'status' , trans ( 'product.error_create_product' ) ) -> with ( 'status_box' , 'danger' ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .