Пример #1
0
 public function CreateAction()
 {
     //Since we don't have laravel's input class registered, we'll just use what I started with.
     $body = $this->detectRequestBody();
     $image = json_decode(stream_get_contents($body), true);
     $netid = isset($_SERVER['NETID']) ? $_SERVER['NETID'] : "notSet";
     $image['netid'] = $netid;
     //then create the new image
     $thisimg = new Image($image);
     //and save it.  Could be reduced to Image::create
     $thisimg->save();
     //return the json object
     return $thisimg->toJSON();
 }