app/Http/Controllers/kategorylemburController.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)
    {
          $rules=[
                'kode_lembur'=>'required|unique:kategory_lemburs,kode_lembur',
                'golongan_id'=>'required',
                'jabatan_id'=>'required',
                'besaran_uang'=>'required',
                ];
        $sms=[
                'kode_lembur.required'=>'Tidak Boleh Kosong',
                'besaran_uang.required'=>'Tidak Boleh Kosong',
                'kode_lembur.unique'=>'Kode Sudah Ada',
                'golongan_id.required'=>'Tidak Boleh Kosong',
                'jabatan_id.required'=>'Tidak Boleh Kosong',
                ];
        $validasi=Validator::make(Input::all(),$rules,$sms);
        if($validasi->fails()){
            return redirect()->back()
            ->WithErrors($validasi)
            ->WithInput();
        }
        $lembur=Request::all();
        KategoryLembur::create($lembur);
        return redirect('lemburkate');
    }
public function store ( Request $ request ) { $ rules = [ 'kode_lembur' => 'required|unique:kategory_lemburs,kode_lembur' , 'golongan_id' => 'required' , 'jabatan_id' => 'required' , 'besaran_uang' => 'required' , ] ; $ sms = [ 'kode_lembur.required' => 'Tidak Boleh Kosong' , 'besaran_uang.required' => 'Tidak Boleh Kosong' , 'kode_lembur.unique' => 'Kode Sudah Ada' , 'golongan_id.required' => 'Tidak Boleh Kosong' , 'jabatan_id.required' => 'Tidak Boleh Kosong' , ] ; $ validasi = Validator :: make ( Input :: all ( ) , $ rules , $ sms ) ; if ( $ validasi -> fails ( ) ) { return redirect ( ) -> back ( ) -> WithErrors ( $ validasi ) -> WithInput ( ) ; } $ lembur = Request :: all ( ) ; KategoryLembur :: create ( $ lembur ) ; return redirect ( 'lemburkate' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// 