app/Http/Controllers/KulinerController.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)
    {
        $this->validate($request,[
            'nama_kuliner' => 'required|',
            'deskripsi' => 'required|',
            'kategori_id' => 'required'
            ]);
        $kuliner = new Kuliner;
        $kuliner->nama_kuliner = $request->nama_kuliner;
        $kuliner->deskripsi = $request->deskripsi;
        $kuliner->kategori_id = $request->kategori_id;
        $kuliner->save();
        return redirect()->route('kuliner.index');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'nama_kuliner' => 'required|' , 'deskripsi' => 'required|' , 'kategori_id' => 'required' ] ) ; $ kuliner = new Kuliner ; $ kuliner -> nama_kuliner = $ request -> nama_kuliner ; $ kuliner -> deskripsi = $ request -> deskripsi ; $ kuliner -> kategori_id = $ request -> kategori_id ; $ kuliner -> save ( ) ; return redirect ( ) -> route ( 'kuliner.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .