Esempio n. 1
0
 /**
  * Restore a soft deleted user.
  *
  * @param  int $userId
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function restore($userId)
 {
     if (!($user = $this->users->findByKey($userId))) {
         return $this->notFound();
     }
     $this->users->restore($user);
     return $this->redirect('edit', [$user->id])->with('success', Lang::get('c::user.restore-success'));
 }
Esempio n. 2
0
 /**
  * Delete an existing user.
  *
  * @param  int $userId
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function delete($userId)
 {
     if (!($user = $this->users->findByKey($userId))) {
         return $this->notFound();
     } elseif ($this->users->delete($user)) {
         return $this->success();
     } else {
         return $this->error('delete failed');
     }
 }