/**
  * 删除
  *
  * @param ineger $id 公众号iD
  */
 public function getDestroy($id)
 {
     $role = $this->roleRepository->getById($id);
     if ($role->user) {
         return responseFail('该角色下存在用户不能删除');
     }
     $this->roleRepository->destroy($id);
     return responseSuccess('删除成功');
 }
示例#2
0
 /**
  * 删除用户
  *
  * @param $id
  * @return mixed
  */
 public function delete($id)
 {
     $this->userRepository->destroy($id);
     return responseSuccess();
 }
示例#3
0
    }
    $i = 0;
    while ($i < 64) {
        $led = $i % 8;
        $prev_led = $led;
        $prev_led--;
        if ($led == 0) {
            $prev_led = 7;
        }
        $pi->getLeds()[$prev_led]->setValue(0);
        $pi->getLeds()[$led]->setValue(1);
        $i++;
        usleep(50000);
    }
    $pi->getLeds()[7]->setValue(0);
    responseSuccess(1);
});
$app->run();
/** 
 * Gets values of inputs/outputs/etc
 *
 * @param Device class object
 * @return Array of values for given class of device
 */
function outputAll($items)
{
    $out = array();
    foreach ($items as $pin) {
        $out[] = $pin->getValue();
    }
    return $out;
 /**
  * 删除
  *
  * @param ineger $id
  */
 public function getDestroy($id)
 {
     $this->articleRepository->destroy($id);
     return responseSuccess('删除成功');
 }
 /**
  * Obtain the user information from GitHub.
  *
  * @return Response
  */
 public function handleCallbackForGithub()
 {
     $user = Socialite::driver('github')->user();
     $data['nickname'] = $user->nickname;
     $data['email'] = $user->email;
     $data['avatar'] = $user->avatar;
     $data['html_url'] = $user->original['html_url'];
     $data['since'] = $user->original['created_at'];
     $data['access_token'] = $user->token['access_token'];
     //保存信息
     $visitor = $this->visitorRepository->store($data);
     Session::put('loginVisitor', $visitor);
     return responseSuccess('登录成功');
 }