app/Http/Controllers/JobTypeController.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(Request $request, $id)
    {
        $jobType = JobType::find($id);
        if($jobType !=null) {
            $this->validate($request,[
                'abbr' => 'required|max:50',
                'name' => 'required|max:200'
            ]);
            $jobType = JobType::setData($jobType, $request);
            $jobType->save();
        }
        return redirect()->route('job_type.index');
    }
public function update ( Request $ request , $ id ) { $ jobType = JobType :: find ( $ id ) ; if ( $ jobType != null ) { $ this -> validate ( $ request , [ 'abbr' => 'required|max:50' , 'name' => 'required|max:200' ] ) ; $ jobType = JobType :: setData ( $ jobType , $ request ) ; $ jobType -> save ( ) ; } return redirect ( ) -> route ( 'job_type.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .