app/Http/Controllers/Admin/employeeterminationController.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(EmployeeTerminationValidator $request)
    {
        if ($request->hasFile('terminationdocument')) {
            $image = $request->file('terminationdocument');
            $term = "TERMINATION-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/EmployeeTermination/', $term);
        }
        $employeetermination = new EmployeeTermination([
            'staffname' => $request->staffname,
            'staffcode' => $request->staffcode,
            'changestatus' => $request->changestatus,
            'noticedate'   => $request->noticedate,
            'serviceenddate' => $request->serviceenddate,
            'desireresigndate' => $request->noticedate,
            'forwardto' => $request->forwardto,
            'reason' => $request->reason,
            'details' => $request->details
        ]);
        $employeetermination->terminationdocument = $term;
        $employeetermination->save();
        return redirect()->route('employeetermination.index')->with('success', 'Employee Termination created successfully');
    }
public function store ( EmployeeTerminationValidator $ request ) { if ( $ request -> hasFile ( 'terminationdocument' ) ) { $ image = $ request -> file ( 'terminationdocument' ) ; $ term = " TERMINATION- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/EmployeeTermination/' , $ term ) ; } $ employeetermination = new EmployeeTermination ( [ 'staffname' => $ request -> staffname , 'staffcode' => $ request -> staffcode , 'changestatus' => $ request -> changestatus , 'noticedate' => $ request -> noticedate , 'serviceenddate' => $ request -> serviceenddate , 'desireresigndate' => $ request -> noticedate , 'forwardto' => $ request -> forwardto , 'reason' => $ request -> reason , 'details' => $ request -> details ] ) ; $ employeetermination -> terminationdocument = $ term ; $ employeetermination -> save ( ) ; return redirect ( ) -> route ( 'employeetermination.index' ) -> with ( 'success' , 'Employee Termination created successfully' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// $prsnl->ctzn_f = $name;