app/Http/Controllers/Admin/employeeresignationController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(EmployeeResignationValidator $request, $id)
    {
        $employeeresignation = EmployeeResignation::findorfail($id);
        if ($request->hasFile('resignationdocument')) {
            $image = $request->file('resignationdocument');
            $res = "RESIGNATION-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/EmployeeResignation/', $res);
            $employeeresignation->resignationdocument = $res;
        }
        $employeeresignation->staffname = $request->input('staffname');
        $employeeresignation->staffcode = $request->input('staffcode');
        $employeeresignation->forwardto = $request->input('forwardto');
        $employeeresignation->noticedate = $request->input('noticedate');
        $employeeresignation->desireresigndate = $request->input('desireresigndate');
        $employeeresignation->reason = $request->input('reason');
        $employeeresignation->details = $request->input('details');
        $employeeresignation->save();
        return redirect()->route('employeeresignation.index')->with('success', 'Employee Resignation Updated Successfully');
    }
public function update ( EmployeeResignationValidator $ request , $ id ) { $ employeeresignation = EmployeeResignation :: findorfail ( $ id ) ; if ( $ request -> hasFile ( 'resignationdocument' ) ) { $ image = $ request -> file ( 'resignationdocument' ) ; $ res = " RESIGNATION- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/EmployeeResignation/' , $ res ) ; $ employeeresignation -> resignationdocument = $ res ; } $ employeeresignation -> staffname = $ request -> input ( 'staffname' ) ; $ employeeresignation -> staffcode = $ request -> input ( 'staffcode' ) ; $ employeeresignation -> forwardto = $ request -> input ( 'forwardto' ) ; $ employeeresignation -> noticedate = $ request -> input ( 'noticedate' ) ; $ employeeresignation -> desireresigndate = $ request -> input ( 'desireresigndate' ) ; $ employeeresignation -> reason = $ request -> input ( 'reason' ) ; $ employeeresignation -> details = $ request -> input ( 'details' ) ; $ employeeresignation -> save ( ) ; return redirect ( ) -> route ( 'employeeresignation.index' ) -> with ( 'success' , 'Employee Resignation Updated Successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .