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([
            'nis' => 'required',
            'nama' => 'required',
            'jk' => 'required',
            'tempat_lahir' => 'required',
            'tanggal_lahir' => 'required',
            'alamat' => 'required',
            'asal_sekolah' => 'required',
            'kelas' => 'required',
            'jurusan' => 'required',
        ]);
        Siswa::create($request->all());
        return redirect()->route('siswas.index')
                        ->with('success','Siswa created successfully.');
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'nis' => 'required' , 'nama' => 'required' , 'jk' => 'required' , 'tempat_lahir' => 'required' , 'tanggal_lahir' => 'required' , 'alamat' => 'required' , 'asal_sekolah' => 'required' , 'kelas' => 'required' , 'jurusan' => 'required' , ] ) ; Siswa :: create ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'siswas.index' ) -> with ( 'success' , 'Siswa created successfully.' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .