app/Http/Controllers/Admin/documentmanagementController.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(DocumentManagementValidator $request)
    {
        if ($request->hasFile('pandocument')) {
            $image = $request->file('pandocument');
            $pan = "PAN-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/PAN Document/', $pan);
        }
        if ($request->hasFile('pfdocument')) {
            $image = $request->file('pfdocument');
            $pf = "PF-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/PF Document/', $pf);
        }
        if ($request->hasFile('citdocument')) {
            $image = $request->file('citdocument');
            $cit = "CIT-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/CIT Document/', $cit);
        }
        if ($request->hasFile('appointmentdocument')) {
            $image = $request->file('appointmentdocument');
            $appointment = "APPOINTMENT-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/Appointment Document/', $appointment);
        }
        if ($request->hasFile('contractdocument')) {
            $image = $request->file('contractdocument');
            $contract = "CONTRACT-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/Contract Document/', $contract);
        }
        $documentmanagement = new DocumentManagement([
            'staffid' =>$request->staffid,
            'staffname' => $request->staffname,
            'bankaccountnumber' => $request->bankaccountnumber,
        ]);
        $documentmanagement->pandocument = $pan;
        $documentmanagement->pfdocument = $pf;
        $documentmanagement->citdocument = $cit;
        $documentmanagement->appointmentdocument = $appointment;
        $documentmanagement->contractdocument = $contract;
        $documentmanagement->save();
        return redirect()->route('documentmanagement.index')->with('success', 'Employee Documents created Successfully');
    }
public function store ( DocumentManagementValidator $ request ) { if ( $ request -> hasFile ( 'pandocument' ) ) { $ image = $ request -> file ( 'pandocument' ) ; $ pan = " PAN- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/PAN Document/' , $ pan ) ; } if ( $ request -> hasFile ( 'pfdocument' ) ) { $ image = $ request -> file ( 'pfdocument' ) ; $ pf = " PF- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/PF Document/' , $ pf ) ; } if ( $ request -> hasFile ( 'citdocument' ) ) { $ image = $ request -> file ( 'citdocument' ) ; $ cit = " CIT- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/CIT Document/' , $ cit ) ; } if ( $ request -> hasFile ( 'appointmentdocument' ) ) { $ image = $ request -> file ( 'appointmentdocument' ) ; $ appointment = " APPOINTMENT- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/Appointment Document/' , $ appointment ) ; } if ( $ request -> hasFile ( 'contractdocument' ) ) { $ image = $ request -> file ( 'contractdocument' ) ; $ contract = " CONTRACT- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/Contract Document/' , $ contract ) ; } $ documentmanagement = new DocumentManagement ( [ 'staffid' => $ request -> staffid , 'staffname' => $ request -> staffname , 'bankaccountnumber' => $ request -> bankaccountnumber , ] ) ; $ documentmanagement -> pandocument = $ pan ; $ documentmanagement -> pfdocument = $ pf ; $ documentmanagement -> citdocument = $ cit ; $ documentmanagement -> appointmentdocument = $ appointment ; $ documentmanagement -> contractdocument = $ contract ; $ documentmanagement -> save ( ) ; return redirect ( ) -> route ( 'documentmanagement.index' ) -> with ( 'success' , 'Employee Documents created Successfully' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// $prsnl->ctzn_f = $name; // $prsnl->ctzn_f = $name; // $prsnl->ctzn_f = $name; // $prsnl->ctzn_f = $name; // $prsnl->ctzn_f = $name; // dd($name); //    dd($prsnl);