Example #1
0
 public function create(CreateRequest $request)
 {
     if ($blog = BlogModel::createBlog($request->input())) {
         $message = $this->getMessage('success', ['id' => $blog->id, 'created_at' => $blog->created_at]);
     } else {
         $message = $this->getMessage('error', [Request::ERROR_DATABASE_INTERNAL_ERROR]);
     }
     return json_encode($message);
 }