mirror of
https://github.com/anonaddy/anonaddy
synced 2026-04-26 01:25:06 +02:00
Added edit default recipient email
This commit is contained in:
@@ -6,6 +6,16 @@ use App\Http\Requests\UpdateDefaultRecipientRequest;
|
||||
|
||||
class DefaultRecipientController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('throttle:1,1')->only('edit');
|
||||
}
|
||||
|
||||
public function update(UpdateDefaultRecipientRequest $request)
|
||||
{
|
||||
$recipient = user()->verifiedRecipients()->findOrFail($request->default_recipient);
|
||||
@@ -15,4 +25,16 @@ class DefaultRecipientController extends Controller
|
||||
|
||||
return back()->with(['status' => 'Default Recipient Updated Successfully']);
|
||||
}
|
||||
|
||||
public function edit(EditDefaultRecipientRequest $request)
|
||||
{
|
||||
$recipient = user()->defaultRecipient;
|
||||
|
||||
$recipient->email = $request->email;
|
||||
$recipient->save();
|
||||
|
||||
user()->sendEmailVerificationNotification();
|
||||
|
||||
return back()->with(['status' => 'Email Updated Successfully, Please Check Your Inbox For The Verification Email']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user