Beispiel #1
0
 public function store()
 {
     try {
         //creates the new AVLog, sets the properties and saves it
         $addModel = Input::json()->all();
         $addLogEntry = new AVLog();
         $user = Auth::user();
         $addLogEntry->room_name = $addModel['room_name'];
         $addLogEntry->message = $addModel['message'];
         $addLogEntry->uid = $user->id;
         $addLogEntry->save();
         return $addLogEntry->toJson();
     } catch (Exception $e) {
         return json_encode('{"error":{"text":' . $e->getMessage() . '}}');
     }
 }