public function emailUserRiskUpdated(Risk $risk) { //get the actionee for the action $user = User::findOrFail($risk->RiskOwner->id); //check if this user wants emails if (!$user->notifyChangedRisks) { return false; } //email the user $this->SendMail($user->email, 'emails.NotifyUserRiskHasChanged', 'Risk you are the owner for has been updated', compact('risk')); return true; }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $user = User::findOrFail($id); return view('Users.edit', compact('user')); }