app/Http/Controllers/BukuController.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' => 'required',
            'tahun_terbit' => 'required',
            'kategori' => 'required',
        ]);
        Buku::create($request->all());
        return redirect()->route('buku.index')
                        ->with('success','Tambah buku sukses');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'nama' => 'required' , 'tahun_terbit' => 'required' , 'kategori' => 'required' , ] ) ; Buku :: create ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'buku.index' ) -> with ( 'success' , 'Tambah buku sukses' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .