app/Http/Controllers/OngkirController.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)
    {
        $create = Ongkir::create([
            'outlet_id' =>  $request->outlet_id,
            'dari' =>  $request->dari,
            'ke' => $request->ke,
            'harga' => $request->harga
        ]);
        if($create){
            return response()->json([
                'status' => true
            ]);
        }
        else{
            return response()->json([
                'status' => false
            ]);
        }
    }
public function store ( Request $ request ) { $ create = Ongkir :: create ( [ 'outlet_id' => $ request -> outlet_id , 'dari' => $ request -> dari , 'ke' => $ request -> ke , 'harga' => $ request -> harga ] ) ; if ( $ create ) { return response ( ) -> json ( [ 'status' => true ] ) ; } else { return response ( ) -> json ( [ 'status' => false ] ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .