app/Http/Controllers/PayrollController.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)
    {
        $data = new Payroll;
        $data->employee_id = $request->input('employee_id');
        $data->basic_salary = $request->input('basic_salary');
        $data->house_rent_allowance = $request->input('house_rent_allowance');
        $data->medical_allowance = $request->input('medical_allowance');
        $data->special_allowance = $request->input('special_allowance');
        $data->provident_fund_contribution = $request->input('provident_fund_contribution');
        $data->other_allowance = $request->input('other_allowance');
        $data->paye_deduction = $request->input('paye_val');
        $data->zero_paye_deduction = $request->input('aids_levy_val');
        $data->nassa_deduction = $request->input('nassa_val');
        $data->net_salary = $request->input('net_salary');
        $data->total_deduction = $request->input('total_deduction');
        $data->save();
        if ($data->save()) {
            return redirect('salary_manage')->withMessage('Salary Saved successfully');
        }
        return redirect('salary_manage')->withMessage('Error while creating');
    }
public function store ( Request $ request ) { $ data = new Payroll ; $ data -> employee_id = $ request -> input ( 'employee_id' ) ; $ data -> basic_salary = $ request -> input ( 'basic_salary' ) ; $ data -> house_rent_allowance = $ request -> input ( 'house_rent_allowance' ) ; $ data -> medical_allowance = $ request -> input ( 'medical_allowance' ) ; $ data -> special_allowance = $ request -> input ( 'special_allowance' ) ; $ data -> provident_fund_contribution = $ request -> input ( 'provident_fund_contribution' ) ; $ data -> other_allowance = $ request -> input ( 'other_allowance' ) ; $ data -> paye_deduction = $ request -> input ( 'paye_val' ) ; $ data -> zero_paye_deduction = $ request -> input ( 'aids_levy_val' ) ; $ data -> nassa_deduction = $ request -> input ( 'nassa_val' ) ; $ data -> net_salary = $ request -> input ( 'net_salary' ) ; $ data -> total_deduction = $ request -> input ( 'total_deduction' ) ; $ data -> save ( ) ; if ( $ data -> save ( ) ) { return redirect ( 'salary_manage' ) -> withMessage ( 'Salary Saved successfully' ) ; } return redirect ( 'salary_manage' ) -> withMessage ( 'Error while creating' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .