src/Laito/Controller.php
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
        ];
    }
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
        ];
    }
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 ] ; }
Update the specified resource in storage

@param array $id Resource ID
@return array Response
Update the specified resource in storage