app/Http/Controllers/AdminController.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)
    { 
        $user = User::find($id);
        $user_type =User::where('id',$id)->pluck('user_type');
        $user->name = $request['name'];
        $user->email = $request['email'];
           $user->company_name = $request['company_name'];
            $user->user_type  =  $user_type;
            $user->contact_no =  $request['contact_no'];
            $user->type_of_scrap = $request['type_of_scrap'];
            $user->products =  $request['products'];
            $user->monthly_scrap_required = $request['monthly_scrap_required'];
            $user->monthly_production = $request['monthly_production'];
            $user->address = $request['address'];
            $user->city = $request ['city'];
            $user->state =  $request['state'];
            $user->country = $request['country'];
            $user->zipcode = $request['zipcode'];
            $user->website = $request['website'];
            $user->description= $request['description'];
            $user->cin_no_or_gst = $request['cin_no_or_gst'];  
            $user->type_of_unit= $request['type_of_unit'];
            $user->installed_capacity= $request['installed_capacity'];
            $user->established_year= $request['established_year'];
            $user->designation= $request['designation'];
            $user->monthly_capacity_tons= $request['monthly_capacity_tons'];
            $user->monthly_scrap_production= $request['monthly_scrap_production'];
            $user->save();
            return back()->with('success','Profile Edit successfully');
    }
public function update ( Request $ request , $ id ) { $ user = User :: find ( $ id ) ; $ user_type = User :: where ( 'id' , $ id ) -> pluck ( 'user_type' ) ; $ user -> name = $ request [ 'name' ] ; $ user -> email = $ request [ 'email' ] ; $ user -> company_name = $ request [ 'company_name' ] ; $ user -> user_type = $ user_type ; $ user -> contact_no = $ request [ 'contact_no' ] ; $ user -> type_of_scrap = $ request [ 'type_of_scrap' ] ; $ user -> products = $ request [ 'products' ] ; $ user -> monthly_scrap_required = $ request [ 'monthly_scrap_required' ] ; $ user -> monthly_production = $ request [ 'monthly_production' ] ; $ user -> address = $ request [ 'address' ] ; $ user -> city = $ request [ 'city' ] ; $ user -> state = $ request [ 'state' ] ; $ user -> country = $ request [ 'country' ] ; $ user -> zipcode = $ request [ 'zipcode' ] ; $ user -> website = $ request [ 'website' ] ; $ user -> description = $ request [ 'description' ] ; $ user -> cin_no_or_gst = $ request [ 'cin_no_or_gst' ] ; $ user -> type_of_unit = $ request [ 'type_of_unit' ] ; $ user -> installed_capacity = $ request [ 'installed_capacity' ] ; $ user -> established_year = $ request [ 'established_year' ] ; $ user -> designation = $ request [ 'designation' ] ; $ user -> monthly_capacity_tons = $ request [ 'monthly_capacity_tons' ] ; $ user -> monthly_scrap_production = $ request [ 'monthly_scrap_production' ] ; $ user -> save ( ) ; return back ( ) -> with ( 'success' , 'Profile Edit successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .