app/Http/Controllers/CompanyController.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)
    {
        $comp = Company::find($id);
        if($comp!=null) {
            $this->validate($request, [
                'name' => 'required|max:100',
                'description' => 'required|max:500',
                'phone' => 'required|max:20',
                'email' => 'required|email',
                'image' => 'required',
                'address' => 'required',
                'contentInfo' => 'required'
            ]);
            $comp = Company::setData($comp, $request);
            $comp->save();
            return redirect()->route('company_job.index');
        }
        return redirect()->route('404');
    }
public function update ( Request $ request , $ id ) { $ comp = Company :: find ( $ id ) ; if ( $ comp != null ) { $ this -> validate ( $ request , [ 'name' => 'required|max:100' , 'description' => 'required|max:500' , 'phone' => 'required|max:20' , 'email' => 'required|email' , 'image' => 'required' , 'address' => 'required' , 'contentInfo' => 'required' ] ) ; $ comp = Company :: setData ( $ comp , $ request ) ; $ comp -> save ( ) ; return redirect ( ) -> route ( 'company_job.index' ) ; } return redirect ( ) -> route ( '404' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .