/**
  * Stores a shout
  * 
  * @return void
  */
 public function store()
 {
     if (!user()) {
         return Response::make(null, 403);
         // 403: Not allowed
     }
     $this->deleteOld();
     $shout = new Shout(['text' => htmlspecialchars(Input::get('text'))]);
     $shout->creator_id = user()->id;
     $okay = $shout->save();
     if (!$okay) {
         return Response::make(null, 500);
     } else {
         return Response::make(null, 200);
     }
 }
Beispiel #2
0
 public function render($parameters = array())
 {
     $shouts = Shout::orderBy('created_at', 'desc')->with('creator')->take(10)->get();
     return View::make('shouts::widget', compact('shouts'))->render();
 }