app/Http/Controllers/TunjanganpController.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)
    {
        $roles=[
                'kode_tunjangan_id'=>'required|unique:tunjangan_pegawais',
                'pegawai_id'=>'required',
            ];
            $sms=[
                'kode_tunjangan_id.required'=>'HARAP DI ISI',
                'kode_tunjangan_id.unique'=>'SUDAH ADA',
                'pegawai_id.required'=>'HARAP DI ISI',
            ];
            $validasi= Validator::make(Input::all(),$roles,$sms);
            if($validasi->fails()){
                return redirect()->back()
                        ->WithErrors($validasi)
                        ->WithInput();
            }
            $tunjanganp=Request::all();
            TunjanganPegawai::create($tunjanganp);
            return redirect('tunjangpegawai');
    }
public function store ( Request $ request ) { $ roles = [ 'kode_tunjangan_id' => 'required|unique:tunjangan_pegawais' , 'pegawai_id' => 'required' , ] ; $ sms = [ 'kode_tunjangan_id.required' => 'HARAP DI ISI' , 'kode_tunjangan_id.unique' => 'SUDAH ADA' , 'pegawai_id.required' => 'HARAP DI ISI' , ] ; $ validasi = Validator :: make ( Input :: all ( ) , $ roles , $ sms ) ; if ( $ validasi -> fails ( ) ) { return redirect ( ) -> back ( ) -> WithErrors ( $ validasi ) -> WithInput ( ) ; } $ tunjanganp = Request :: all ( ) ; TunjanganPegawai :: create ( $ tunjanganp ) ; return redirect ( 'tunjangpegawai' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//