Пример #1
0
 public function detailsTimerAction($id)
 {
     $timer = Timers::find($id);
     $content = Input::get('notes');
     if (!empty($content)) {
         $content = nl2br(htmlentities($content));
         $note = new Notes(array('content' => $content));
         $note->user()->associate(Auth::user());
         $timer->notes()->save($note);
         return Redirect::route('details', $timer->id)->with('flash_msg', 'Note added.');
     }
     return Redirect::route('details', $timer->id)->with('flash_error', 'Unable to add note. Try adding some content.');
 }