app/Http/Controllers/ProfileCompanyController.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)
    {
        $request->validate( [
            'phone' => 'required|max:10',
            'name'  => 'required',
        ], $this->messages() );
        $company             = Company::find( $id );
        $company->name = $request->input( 'name' );
        $company->location      = $request->input( 'location' );
        $company->url= $request->input('url');
        $company->description= $request->input('notes');
        $company->update();
        $company->save();
        return redirect( '/profileCompany' )->with( "ok", "Chỉnh sửa profile thành công" );
    }
public function update ( Request $ request , $ id ) { $ company = Company :: find ( $ id ) ; $ company -> name = $ request -> input ( 'name' ) ; $ company -> location = $ request -> input ( 'location' ) ; $ company -> url = $ request -> input ( 'url' ) ; $ company -> description = $ request -> input ( 'notes' ) ; $ company -> update ( ) ; $ company -> save ( ) ; return redirect ( '/profileCompany' ) -> with ( " ok " , " Chỉnh sửa profile thành công" ); }
Update the specified resource in storage.
Update the specified resource in storage .
// //        $request->validate( [ //            'phone' => 'required|max:10', //            'name'  => 'required', //        ], $this->messages() );