コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request, Note $noteModel, History $historyModel)
 {
     if (right('AddNewPublicNote')) {
         if (strlen($_POST['notification']) > 0) {
             $noteModel->addNote($_POST['notification']);
             $historyModel->saveHistory('create_note');
             Session::flash('message', GetMessages("ADD_NEW_NOTE_MESSAGE"));
             return redirect()->route('note.index');
         } else {
             Session::flash('message', GetMessages("EMPTY_NOTE_MESSAGE"));
             return redirect()->route('note.index');
         }
     } else {
         Session::flash('message', GetMessages("NO_RIGHTS"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
 }