app/Http/Controllers/BarangController.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)
    {
        Barang::create([
            'id_lab' => $request->id_lab,
            'nama_barang' => $request->nama_barang,
            'harga' => $request->harga
                ]);
        return redirect()->route('barang.index')
        ->with('message', 'Data berhasil disimpan');
    }
public function store ( Request $ request ) { Barang :: create ( [ 'id_lab' => $ request -> id_lab , 'nama_barang' => $ request -> nama_barang , 'harga' => $ request -> harga ] ) ; return redirect ( ) -> route ( 'barang.index' ) -> with ( 'message' , 'Data berhasil disimpan' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .