app/Http/Controllers/HomeController.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)
    {
        $shop = Auth::user();
        $widget = Widget::where('id', $request->get('id'))->first();
        $this->deleteCode($shop,$widget);
        $widget->room = $request->get('room');
        $widget->position = $request->get('position');
        $widget->text = $request->get('text');
        $widget->html_code =$request->get('html_code');
        $widget->save();
        sleep(3);
        $this->AddCode($request->get('html_code'),$widget);
        return response()->json('Done');
    }
public function update ( Request $ request ) { $ shop = Auth :: user ( ) ; $ widget = Widget :: where ( 'id' , $ request -> get ( 'id' ) ) -> first ( ) ; $ this -> deleteCode ( $ shop , $ widget ) ; $ widget -> room = $ request -> get ( 'room' ) ; $ widget -> position = $ request -> get ( 'position' ) ; $ widget -> text = $ request -> get ( 'text' ) ; $ widget -> html_code = $ request -> get ( 'html_code' ) ; $ widget -> save ( ) ; sleep ( 3 ) ; $ this -> AddCode ( $ request -> get ( 'html_code' ) , $ widget ) ; return response ( ) -> json ( 'Done' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//Delete Code  //Update Code