original_string: public function update($id = null, $attributes = [])
      {
          // Check the ID
          if (!isset($id)) {
              throw new \InvalidArgumentException('Undefined ID', 400);
          }
  
          // Set the attributes
          $attributes = (!empty($attributes))? $attributes : $this->app->request->input();
  
          // Update the record
          $result = $this->model->update($id, $attributes);
  
          // Return results
          return [
              'success' => true,
              'id' => $id,
              'data' => $result
          ];
      }
code: public function update($id = null, $attributes = [])
      {
          // Check the ID
          if (!isset($id)) {
              throw new \InvalidArgumentException('Undefined ID', 400);
          }
  
          // Set the attributes
          $attributes = (!empty($attributes))? $attributes : $this->app->request->input();
  
          // Update the record
          $result = $this->model->update($id, $attributes);
  
          // Return results
          return [
              'success' => true,
              'id' => $id,
              'data' => $result
          ];
      }
code_tokens: public function update ( $ id = null , $ attributes = [ ] ) { // Check the ID if ( ! isset ( $ id ) ) { throw new \ InvalidArgumentException ( 'Undefined ID' , 400 ) ; } // Set the attributes $ attributes = ( ! empty ( $ attributes ) ) ? $ attributes : $ this -> app -> request -> input ( ) ; // Update the record $ result = $ this -> model -> update ( $ id , $ attributes ) ; // Return results return [ 'success' => true , 'id' => $ id , 'data' => $ result ] ; }
docstring: Update the specified resource in storage
  
  @param array $id Resource ID
  @return array Response
docstring_tokens: Update the specified resource in storage