Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/controllers/CommentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public function index()
*/
public function store()
{
// Check if input values are available, else return error
+ if ( ! Input::has('author') || ! Input::has('text')) {
+ return Response::json(array('error' => 'Please fill the form properly.' ));
+ }
Comment::create(array(
'author' => Input::get('author'),
'text' => Input::get('text')
Expand Down Expand Up @@ -51,4 +55,4 @@ public function destroy($id)
return Response::json(array('success' => true));
}

}
}