app/Http/Controllers/Admin/employeeresignationController.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(EmployeeResignationValidator $request)
    {
        if ($request->hasFile('resignationdocument')) {
            $image = $request->file('resignationdocument');
            $res = "RESIGNATION-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/EmployeeResignation/', $res);
        }
        $employeeresignation = new EmployeeResignation([
            'staffname' => $request->staffname,
            'staffcode' => $request->staffcode,
            'noticedate' => $request->noticedate,
            'forwardto' => $request->forwardto,
            'desireresigndate' => $request->desireresigndate,
            'reason' => $request->reason,
            'details' => $request->details
        ]);
        $employeeresignation->resignationdocument = $res;
        $employeeresignation->save();
        return redirect()->route('employeeresignation.index')->with('success', 'Employee Resignation created successfully');
    }
public function store ( EmployeeResignationValidator $ request ) { if ( $ request -> hasFile ( 'resignationdocument' ) ) { $ image = $ request -> file ( 'resignationdocument' ) ; $ res = " RESIGNATION- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/EmployeeResignation/' , $ res ) ; } $ employeeresignation = new EmployeeResignation ( [ 'staffname' => $ request -> staffname , 'staffcode' => $ request -> staffcode , 'noticedate' => $ request -> noticedate , 'forwardto' => $ request -> forwardto , 'desireresigndate' => $ request -> desireresigndate , 'reason' => $ request -> reason , 'details' => $ request -> details ] ) ; $ employeeresignation -> resignationdocument = $ res ; $ employeeresignation -> save ( ) ; return redirect ( ) -> route ( 'employeeresignation.index' ) -> with ( 'success' , 'Employee Resignation created successfully' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .