app/Http/Controllers/SiswaController.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)
    {
        $request->validate([
            'nisn' => 'required',
            'nama' => 'required',
            'tempatlahir' => 'required',
            'tanggallahir'=>'required',
            'jeniskelamin'=>'required',
            'agama'=>'required',
            'alamat'=>'required',
        ]);
        Siswa::create($request->all());
        return redirect()->route('sisw.index')->with('succes','Data Berhasil di Input');
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'nisn' => 'required' , 'nama' => 'required' , 'tempatlahir' => 'required' , 'tanggallahir' => 'required' , 'jeniskelamin' => 'required' , 'agama' => 'required' , 'alamat' => 'required' , ] ) ; Siswa :: create ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'sisw.index' ) -> with ( 'succes' , 'Data Berhasil di Input' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .