Learner\Repositories\BlogRepositoryInterface::toggleTop PHP Method

toggleTop() public method

Change blog's toped status.
public toggleTop ( integer $id ) : boolean
$id integer
return boolean
    public function toggleTop($id);

Usage Example

Example #1
0
 /**
  * Toggle blog toped.
  *
  * /admin/blogs/toggleTop/{id} put
  *
  * @param  integer $id
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function toggleTop($id)
 {
     if ($this->blogs->toggleTop($id)) {
         $message = '博客顶置成功';
     } else {
         $message = '博客取消顶置';
     }
     return $this->responseJson(compact('message'));
 }