Completed
Push — development ( b579bd...8aa65f )
by Claudio
01:58
created
app/Http/Controllers/MailController.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         if (!Config::get('mail.enable'))
25 25
             return;
26 26
 
27
-        Mail::send($view, $configuration, function ($message) use ($configuration) {
27
+        Mail::send($view, $configuration, function($message) use ($configuration) {
28 28
             $message->from(Config::get('mail.from.address'), Config::get('mail.from.name'));
29 29
             $message->to($configuration['email'])->subject($configuration['subject']);
30 30
         });
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function send(array $configuration, string $view = 'habbo-web-mail.confirm-mail')
23 23
     {
24
-        if (!Config::get('mail.enable'))
25
-            return;
24
+        if (!Config::get('mail.enable')) {
25
+                    return;
26
+        }
26 27
 
27 28
         Mail::send($view, $configuration, function ($message) use ($configuration) {
28 29
             $message->from(Config::get('mail.from.address'), Config::get('mail.from.name'));
@@ -54,8 +55,9 @@  discard block
 block discarded – undo
54 55
     {
55 56
         $mailRequest = MailModel::where('token', $token)->where('used', '0')->first();
56 57
 
57
-        if ($mailRequest !== null)
58
-            $mailRequest->update(['used' => '1']);
58
+        if ($mailRequest !== null) {
59
+                    $mailRequest->update(['used' => '1']);
60
+        }
59 61
 
60 62
         return $mailRequest;
61 63
     }
Please login to merge, or discard this patch.
Switch Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,62 +1,62 @@
 block discarded – undo
1
-<?php
1
+ <?php
2 2
 
3
-namespace App\Http\Controllers;
3
+ namespace App\Http\Controllers;
4 4
 
5
-use App\Models\Mail as MailModel;
6
-use Illuminate\Support\Facades\Config;
7
-use Illuminate\Support\Facades\Mail;
8
-use Laravel\Lumen\Routing\Controller as BaseController;
5
+ use App\Models\Mail as MailModel;
6
+ use Illuminate\Support\Facades\Config;
7
+ use Illuminate\Support\Facades\Mail;
8
+ use Laravel\Lumen\Routing\Controller as BaseController;
9 9
 
10 10
 /**
11 11
  * Class MailController
12 12
  * @package App\Http\Controllers
13 13
  */
14
-class MailController extends BaseController
15
-{
16
-    /**
14
+ class MailController extends BaseController
15
+ {
16
+     /**
17 17
      * Send an Email
18 18
      *
19 19
      * @param array $configuration
20 20
      * @param string $view
21 21
      */
22
-    public function send(array $configuration, string $view = 'habbo-web-mail.confirm-mail')
23
-    {
24
-        if (!Config::get('mail.enable'))
25
-            return;
26
-
27
-        Mail::send($view, $configuration, function ($message) use ($configuration) {
28
-            $message->from(Config::get('mail.from.address'), Config::get('mail.from.name'));
29
-            $message->to($configuration['email'])->subject($configuration['subject']);
30
-        });
31
-    }
32
-
33
-    /**
22
+     public function send(array $configuration, string $view = 'habbo-web-mail.confirm-mail')
23
+     {
24
+         if (!Config::get('mail.enable'))
25
+             return;
26
+
27
+         Mail::send($view, $configuration, function ($message) use ($configuration) {
28
+             $message->from(Config::get('mail.from.address'), Config::get('mail.from.name'));
29
+             $message->to($configuration['email'])->subject($configuration['subject']);
30
+         });
31
+     }
32
+
33
+     /**
34 34
      * Prepare the E-Mail
35 35
      *
36 36
      * @param string $email
37 37
      * @param string $url
38 38
      * @return string
39 39
      */
40
-    public function prepare(string $email, string $url): string
41
-    {
42
-        (new MailModel)->store($token = uniqid('HabboMail', true), $url, $email)->save();
40
+     public function prepare(string $email, string $url): string
41
+     {
42
+         (new MailModel)->store($token = uniqid('HabboMail', true), $url, $email)->save();
43 43
 
44
-        return $token;
45
-    }
44
+         return $token;
45
+     }
46 46
 
47
-    /**
47
+     /**
48 48
      * Get E-Mail by Controller
49 49
      *
50 50
      * @param string $token
51 51
      * @return object
52 52
      */
53
-    public function getMail(string $token)
54
-    {
55
-        $mailRequest = MailModel::where('token', $token)->where('used', '0')->first();
53
+     public function getMail(string $token)
54
+     {
55
+         $mailRequest = MailModel::where('token', $token)->where('used', '0')->first();
56 56
 
57
-        if ($mailRequest !== null)
58
-            $mailRequest->update(['used' => '1']);
57
+         if ($mailRequest !== null)
58
+             $mailRequest->update(['used' => '1']);
59 59
 
60
-        return $mailRequest;
61
-    }
60
+         return $mailRequest;
61
+     }
62 62
 }
Please login to merge, or discard this patch.