/**
* Remove the specified user from storage.
*
* @param string $hash
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, $id)
{
// Fetch the user object
//$id = $this->decode($hash);
$user = $this->userRepository->findById($id);
// Remove the user
$user->delete();
// All done
$message = "{$user->email} has been removed.";
if ($request->ajax()) {
return response()->json([$message], 200);
}
session()->flash('success', $message);
return redirect()->route('users.index');
}