app/Http/Controllers/mahasiswaController.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(['nim'=>'required|digits:10','nama_lengkap'=>'required']);
        mahasiswa::create($request->all());
        return redirect()->route('mhs.index')->with('success','data berhasil ditambahkan');
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'nim' => 'required|digits:10' , 'nama_lengkap' => 'required' ] ) ; mahasiswa :: create ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'mhs.index' ) -> with ( 'success' , 'data berhasil ditambahkan' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .