app/Http/Controllers/ProgramStudiController.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)
    {
        date_default_timezone_set("Asia/Bangkok");
        $request->validate([
            'kode_ps' => 'required',
            'nama_programstudi' => 'required'
        ]);
        ProgramStudi::create([
            'kode_ps' => $request->kode_ps,
            'nama_programstudi' => $request->nama_programstudi
            ]);
        return redirect()->route('programstudi.index')
                        ->with('success', 'Data Baru berhasil dibuat');
    }
public function store ( Request $ request ) { date_default_timezone_set ( " Asia/Bangkok " ) ; $ request -> validate ( [ 'kode_ps' => 'required' , 'nama_programstudi' => 'required' ] ) ; ProgramStudi :: create ( [ 'kode_ps' => $ request -> kode_ps , 'nama_programstudi' => $ request -> nama_programstudi ] ) ; return redirect ( ) -> route ( 'programstudi.index' ) -> with ( 'success' , 'Data Baru berhasil dibuat' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .