app/Http/Controllers/CourierController.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)
    {
        if(Courier::where('courier',$request->courier)->exists()){
            return redirect('/courier')->with('gagal','Data kurir sudah terdaftar!');
        }
        $courier = new Courier;
        $courier->courier = $request->courier;
        $courier->save();
        return redirect('/courier')->with('berhasil','Data kurir berhasil ditambahkan!');
    }
public function store ( Request $ request ) { if ( Courier :: where ( 'courier' , $ request -> courier ) -> exists ( ) ) { return redirect ( '/courier' ) -> with ( 'gagal' , 'Data kurir sudah terdaftar!' ) ; } $ courier = new Courier ; $ courier -> courier = $ request -> courier ; $ courier -> save ( ) ; return redirect ( '/courier' ) -> with ( 'berhasil' , 'Data kurir berhasil ditambahkan!' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//menyimpan data kurir