/**
  * render interface to edit a exists email
  *
  * @param $id
  * @param $person_id
  * @return \Illuminate\View\View
  */
 public function edit($person_id, $id)
 {
     $email = Email::where(['person_id' => $person_id, 'id' => $id])->first();
     if (count($email) != 1) {
         return view('errors.404');
     }
     return view('email.save', compact('email'));
 }
 /**
  * remove from database a email of a person
  *
  * @param $person_id
  * @param $id
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroy($person_id, $id)
 {
     $email = $this->model->where(['person_id' => $person_id, 'id' => $id])->first();
     if (count($email) != 1) {
         return view('errors.404');
     }
     if ($email->delete()) {
         session(['success' => "o email [{$email->email}] foi removido com sucesso!"]);
     } else {
         session(['error' => "o email [{$email->email}] não foi removido!"]);
     }
     return redirect()->back();
 }