@@ -94,7 +94,7 @@ public function index(): View
9494 public function update (MailSettingsFormRequest $ request ): RedirectResponse
9595 {
9696 if ($ this ->config ->get ('mail.driver ' ) !== 'smtp ' ) {
97- throw $ this -> smtpNotSelectedException ( );
97+ throw new DisplayException ( ' This feature is only available if SMTP is the selected email driver for the Panel. ' );
9898 }
9999
100100 $ values = $ request ->normalize ();
@@ -119,16 +119,11 @@ public function update(MailSettingsFormRequest $request): RedirectResponse
119119 /**
120120 * Submit a request to send a test mail message.
121121 *
122- * @throws DisplayException
123122 * @param Request $request
124123 * @return \Illuminate\Http\RedirectResponse
125124 */
126125 public function test (Request $ request ): RedirectResponse
127126 {
128- if ($ this ->config ->get ('mail.driver ' ) !== 'smtp ' ) {
129- throw $ this ->smtpNotSelectedException ();
130- }
131-
132127 try {
133128 Notification::route ('mail ' , $ request ->user ()->email )
134129 ->notify (new MailTested ($ request ->user ()));
@@ -140,13 +135,4 @@ public function test(Request $request): RedirectResponse
140135 $ this ->alert ->success (trans ('base.mail.test_succeeded ' ))->flash ();
141136 return redirect ()->route ('admin.settings.mail ' );
142137 }
143-
144- /**
145- * Generate a display exception for non-SMTP configurations.
146- *
147- * @return DisplayException
148- */
149- private function smtpNotSelectedException () {
150- return new DisplayException ('This feature is only available if SMTP is the selected email driver for the Panel. ' );
151- }
152138}
0 commit comments