Completed
Push — development ( 93963f...b579bd )
by Claudio
04:27
created
app/Http/Middleware/Authenticate.php 1 patch
Switch Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,34 +1,34 @@  discard block
 block discarded – undo
1
-<?php
1
+ <?php
2 2
 
3
-namespace App\Http\Middleware;
3
+ namespace App\Http\Middleware;
4 4
 
5
-use Closure;
6
-use Illuminate\Contracts\Auth\Factory as Auth;
7
-use Illuminate\Http\Request;
5
+ use Closure;
6
+ use Illuminate\Contracts\Auth\Factory as Auth;
7
+ use Illuminate\Http\Request;
8 8
 
9 9
 /**
10 10
  * Class Authenticate.
11 11
  */
12
-class Authenticate
13
-{
14
-    /**
12
+ class Authenticate
13
+ {
14
+     /**
15 15
      * The authentication guard factory instance.
16 16
      *
17 17
      * @var Auth
18 18
      */
19
-    protected $auth;
19
+     protected $auth;
20 20
 
21
-    /**
21
+     /**
22 22
      * Create a new middleware instance.
23 23
      *
24 24
      * @param Auth $auth
25 25
      */
26
-    public function __construct(Auth $auth)
27
-    {
28
-        $this->auth = $auth;
29
-    }
26
+     public function __construct(Auth $auth)
27
+     {
28
+         $this->auth = $auth;
29
+     }
30 30
 
31
-    /**
31
+     /**
32 32
      * Handle an incoming request.
33 33
      *
34 34
      * @param Request     $request
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
      *
38 38
      * @return mixed
39 39
      */
40
-    public function handle($request, Closure $next, $guard = null)
41
-    {
42
-        if ($this->auth->guard($guard)->guest()) {
43
-            return response()->json(['message' => 'authentication-needed'], 401);
44
-        }
40
+     public function handle($request, Closure $next, $guard = null)
41
+     {
42
+         if ($this->auth->guard($guard)->guest()) {
43
+             return response()->json(['message' => 'authentication-needed'], 401);
44
+         }
45 45
 
46
-        if ($request->user()->isBanned == true) {
47
-            return response('Unauthorized.', 401);
48
-        }
46
+         if ($request->user()->isBanned == true) {
47
+             return response('Unauthorized.', 401);
48
+         }
49 49
 
50
-        return $next($request);
51
-    }
50
+         return $next($request);
51
+     }
52 52
 }
Please login to merge, or discard this patch.
app/Http/Middleware/Cors.php 1 patch
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  discard block
 block discarded – undo
1
-<?php
1
+ <?php
2 2
 
3
-namespace App\Http\Middleware;
3
+ namespace App\Http\Middleware;
4 4
 
5
-use Closure;
6
-use Illuminate\Http\Request;
7
-use Illuminate\Support\Facades\Config;
5
+ use Closure;
6
+ use Illuminate\Http\Request;
7
+ use Illuminate\Support\Facades\Config;
8 8
 
9 9
 /**
10 10
  * Class Cors.
11 11
  */
12
-class Cors
13
-{
14
-    /**
12
+ class Cors
13
+ {
14
+     /**
15 15
      * Handle an incoming request.
16 16
      *
17 17
      * @param Request $request
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
      *
20 20
      * @return mixed
21 21
      */
22
-    public function handle($request, Closure $next)
23
-    {
24
-        return $next($request)
25
-            ->header('Access-Control-Allow-Origin', implode(',', Config::get('chocolatey.cors')))
26
-            ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
27
-    }
22
+     public function handle($request, Closure $next)
23
+     {
24
+         return $next($request)
25
+             ->header('Access-Control-Allow-Origin', implode(',', Config::get('chocolatey.cors')))
26
+             ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
27
+     }
28 28
 }
Please login to merge, or discard this patch.
app/Providers/AuthServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
      */
20 20
     public function boot()
21 21
     {
22
-        $this->app['auth']->viaRequest('api', function ($request) {
22
+        $this->app['auth']->viaRequest('api', function($request) {
23 23
             return User::getInstance()->getUser();
24 24
         });
25 25
     }
Please login to merge, or discard this patch.
app/Helpers/Nux.php 1 patch
Switch Indentation   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -40,166 +40,166 @@
 block discarded – undo
40 40
         switch ($request->json()->get('roomIndex')):
41 41
             case 1:
42 42
                 return $this->createBedRoom($request->user());
43
-        case 2:
44
-                return $this->createPoolRoom($request->user());
45
-        case 3:
46
-                return $this->createClubRoom($request->user());
47
-        default:
48
-                return false;
49
-        endswitch;
50
-    }
51
-
52
-    /**
43
+         case 2:
44
+                 return $this->createPoolRoom($request->user());
45
+         case 3:
46
+                 return $this->createClubRoom($request->user());
47
+         default:
48
+                 return false;
49
+         endswitch;
50
+     }
51
+
52
+     /**
53 53
      * Create the NUX Bed Room.
54 54
      *
55 55
      * @param User $user
56 56
      *
57 57
      * @return bool
58 58
      */
59
-    protected function createBedRoom(User $user): bool
60
-    {
61
-        $room = (new Room())->store("{$user->name}'s room", "{$user->name} has entered the building", 'model_h', 25, 12, 610, 2403, 0.0, $user->uniqueId, $user->name);
62
-
63
-        $user->update(['home_room' => $room->id]);
64
-
65
-        // Floor Items
66
-        (new RoomItem())->store($user->uniqueId, $room->id, 15542, 9, 9, '0.00000', 4, '');
67
-        (new RoomItem())->store($user->uniqueId, $room->id, 15542, 9, 12, '0.00000', 0, '');
68
-        (new RoomItem())->store($user->uniqueId, $room->id, 15542, 10, 9, '0.00000', 4, '');
69
-        (new RoomItem())->store($user->uniqueId, $room->id, 15542, 10, 12, '0.00000', 0, '');
70
-        (new RoomItem())->store($user->uniqueId, $room->id, 16412, 9, 5, '1.00000', 0, '');
71
-        (new RoomItem())->store($user->uniqueId, $room->id, 16435, 7, 5, '1.00000', 0, '');
72
-        (new RoomItem())->store($user->uniqueId, $room->id, 16486, 8, 5, '1.00000', 0, '');
73
-        (new RoomItem())->store($user->uniqueId, $room->id, 17816, 6, 2, '1.00000', 0, '4');
74
-        (new RoomItem())->store($user->uniqueId, $room->id, 17816, 9, 2, '1.00000', 0, '4');
75
-        (new RoomItem())->store($user->uniqueId, $room->id, 17824, 7, 2, '1.00000', 0, '1');
76
-        (new RoomItem())->store($user->uniqueId, $room->id, 17894, 9, 10, '0.00000', 0, '');
77
-        (new RoomItem())->store($user->uniqueId, $room->id, 18074, 8, 4, '1.00000', 0, '1');
78
-        (new RoomItem())->store($user->uniqueId, $room->id, 18817, 3, 10, '0.01000', 2, '');
79
-        (new RoomItem())->store($user->uniqueId, $room->id, 18835, 3, 9, '0.00000', 0, '');
80
-        (new RoomItem())->store($user->uniqueId, $room->id, 18835, 3, 11, '0.00000', 0, '');
81
-        (new RoomItem())->store($user->uniqueId, $room->id, 18835, 5, 9, '0.00000', 0, '');
82
-        (new RoomItem())->store($user->uniqueId, $room->id, 18835, 5, 11, '0.00000', 0, '');
83
-
84
-        // Wall Items
85
-        (new RoomItem())->store($user->uniqueId, $room->id, 22988, 0, 0, '0', 0, '', ':w=4,2 l=0,35 l');
86
-        (new RoomItem())->store($user->uniqueId, $room->id, 23163, 0, 0, '0', 0, '1', ':w=4,8 l=0,43 r');
87
-        (new RoomItem())->store($user->uniqueId, $room->id, 23261, 0, 0, '0', 0, '', ':w=2,10 l=2,34 l');
88
-        (new RoomItem())->store($user->uniqueId, $room->id, 23331, 0, 0, '0', 0, '', ':w=2,10 l=2,29 l');
89
-
90
-        return true;
91
-    }
92
-
93
-    /**
59
+     protected function createBedRoom(User $user): bool
60
+     {
61
+         $room = (new Room())->store("{$user->name}'s room", "{$user->name} has entered the building", 'model_h', 25, 12, 610, 2403, 0.0, $user->uniqueId, $user->name);
62
+
63
+         $user->update(['home_room' => $room->id]);
64
+
65
+         // Floor Items
66
+         (new RoomItem())->store($user->uniqueId, $room->id, 15542, 9, 9, '0.00000', 4, '');
67
+         (new RoomItem())->store($user->uniqueId, $room->id, 15542, 9, 12, '0.00000', 0, '');
68
+         (new RoomItem())->store($user->uniqueId, $room->id, 15542, 10, 9, '0.00000', 4, '');
69
+         (new RoomItem())->store($user->uniqueId, $room->id, 15542, 10, 12, '0.00000', 0, '');
70
+         (new RoomItem())->store($user->uniqueId, $room->id, 16412, 9, 5, '1.00000', 0, '');
71
+         (new RoomItem())->store($user->uniqueId, $room->id, 16435, 7, 5, '1.00000', 0, '');
72
+         (new RoomItem())->store($user->uniqueId, $room->id, 16486, 8, 5, '1.00000', 0, '');
73
+         (new RoomItem())->store($user->uniqueId, $room->id, 17816, 6, 2, '1.00000', 0, '4');
74
+         (new RoomItem())->store($user->uniqueId, $room->id, 17816, 9, 2, '1.00000', 0, '4');
75
+         (new RoomItem())->store($user->uniqueId, $room->id, 17824, 7, 2, '1.00000', 0, '1');
76
+         (new RoomItem())->store($user->uniqueId, $room->id, 17894, 9, 10, '0.00000', 0, '');
77
+         (new RoomItem())->store($user->uniqueId, $room->id, 18074, 8, 4, '1.00000', 0, '1');
78
+         (new RoomItem())->store($user->uniqueId, $room->id, 18817, 3, 10, '0.01000', 2, '');
79
+         (new RoomItem())->store($user->uniqueId, $room->id, 18835, 3, 9, '0.00000', 0, '');
80
+         (new RoomItem())->store($user->uniqueId, $room->id, 18835, 3, 11, '0.00000', 0, '');
81
+         (new RoomItem())->store($user->uniqueId, $room->id, 18835, 5, 9, '0.00000', 0, '');
82
+         (new RoomItem())->store($user->uniqueId, $room->id, 18835, 5, 11, '0.00000', 0, '');
83
+
84
+         // Wall Items
85
+         (new RoomItem())->store($user->uniqueId, $room->id, 22988, 0, 0, '0', 0, '', ':w=4,2 l=0,35 l');
86
+         (new RoomItem())->store($user->uniqueId, $room->id, 23163, 0, 0, '0', 0, '1', ':w=4,8 l=0,43 r');
87
+         (new RoomItem())->store($user->uniqueId, $room->id, 23261, 0, 0, '0', 0, '', ':w=2,10 l=2,34 l');
88
+         (new RoomItem())->store($user->uniqueId, $room->id, 23331, 0, 0, '0', 0, '', ':w=2,10 l=2,29 l');
89
+
90
+         return true;
91
+     }
92
+
93
+     /**
94 94
      * Create the Pool Room.
95 95
      *
96 96
      * @param User $user
97 97
      *
98 98
      * @return bool
99 99
      */
100
-    protected function createPoolRoom(User $user): bool
101
-    {
102
-        $room = (new Room())->store("{$user->name}'s room", "{$user->name} has entered the building", 'model_h', 25, 12, 307, 3104, 1.10, $user->uniqueId, $user->name);
103
-
104
-        $user->update(['home_room' => $room->id]);
105
-
106
-        // Floor Items
107
-        (new RoomItem())->store($user->uniqueId, $room->id, 16715, 5, 11, 1.30000, 0, '');
108
-        (new RoomItem())->store($user->uniqueId, $room->id, 16732, 3, 10, 0.40000, 0, '');
109
-        (new RoomItem())->store($user->uniqueId, $room->id, 17016, 3, 9, 0.00000, 2, '1');
110
-        (new RoomItem())->store($user->uniqueId, $room->id, 17016, 3, 11, 0.00000, 0, '');
111
-        (new RoomItem())->store($user->uniqueId, $room->id, 17016, 4, 9, 0.00000, 4, '');
112
-        (new RoomItem())->store($user->uniqueId, $room->id, 17090, 3, 9, 0.00000, 2, '1');
113
-        (new RoomItem())->store($user->uniqueId, $room->id, 17176, 3, 9, 0.00000, 0, '');
114
-        (new RoomItem())->store($user->uniqueId, $room->id, 17176, 3, 9, 0.40000, 0, '');
115
-        (new RoomItem())->store($user->uniqueId, $room->id, 17176, 3, 10, 0.00000, 0, '');
116
-        (new RoomItem())->store($user->uniqueId, $room->id, 17190, 3, 11, 0.00000, 2, '');
117
-        (new RoomItem())->store($user->uniqueId, $room->id, 17190, 4, 9, 0.00000, 4, '');
118
-        (new RoomItem())->store($user->uniqueId, $room->id, 17191, 3, 10, 0.40000, 2, '');
119
-        (new RoomItem())->store($user->uniqueId, $room->id, 17191, 3, 12, 0.00000, 2, '');
120
-        (new RoomItem())->store($user->uniqueId, $room->id, 17484, 8, 3, 1.00000, 0, '0', 0);
121
-        (new RoomItem())->store($user->uniqueId, $room->id, 17499, 7, 3, 1.00000, 2, '');
122
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 7, 2, 1.00000, 0, '');
123
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 7, 4, 1.00000, 0, '');
124
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 7, 5, 1.00000, 0, '');
125
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 8, 2, 1.00000, 0, '');
126
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 8, 5, 1.00000, 0, '');
127
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 9, 2, 1.00000, 0, '');
128
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 9, 5, 1.00000, 0, '');
129
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 10, 2, 1.00000, 0, '');
130
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 10, 3, 1.00000, 0, '');
131
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 10, 4, 1.00000, 0, '');
132
-        (new RoomItem())->store($user->uniqueId, $room->id, 17520, 10, 5, 1.00000, 0, '');
133
-        (new RoomItem())->store($user->uniqueId, $room->id, 17987, 5, 11, 0.00000, 0, '');
134
-        (new RoomItem())->store($user->uniqueId, $room->id, 18051, 5, 2, 1.00000, 0, '');
135
-        (new RoomItem())->store($user->uniqueId, $room->id, 18051, 5, 4, 1.00000, 0, '');
136
-        (new RoomItem())->store($user->uniqueId, $room->id, 18051, 8, 9, 0.00000, 0, '');
137
-        (new RoomItem())->store($user->uniqueId, $room->id, 18051, 8, 11, 0.00000, 0, '');
138
-        (new RoomItem())->store($user->uniqueId, $room->id, 18051, 9, 9, 0.00000, 0, '');
139
-        (new RoomItem())->store($user->uniqueId, $room->id, 18051, 9, 11, 0.00000, 0, '');
140
-        (new RoomItem())->store($user->uniqueId, $room->id, 18061, 8, 8, 0.00000, 2, '');
141
-        (new RoomItem())->store($user->uniqueId, $room->id, 18061, 8, 9, 0.00000, 6, '1');
142
-        (new RoomItem())->store($user->uniqueId, $room->id, 18061, 10, 8, 0.00000, 4, '1');
143
-        (new RoomItem())->store($user->uniqueId, $room->id, 18070, 8, 2, 1.50000, 0, '1');
144
-        (new RoomItem())->store($user->uniqueId, $room->id, 18079, 9, 8, 0.00000, 0, '1');
145
-        (new RoomItem())->store($user->uniqueId, $room->id, 18363, 3, 9, 0.80000, 0, '2');
146
-
147
-        // Wall Items
148
-        (new RoomItem())->store($user->uniqueId, $room->id, 22996, 0, 0, '0', 0, '', ':w=4,8 l=7,45 r');
149
-        (new RoomItem())->store($user->uniqueId, $room->id, 22996, 0, 0, '0', 0, '', ':w=4,8 l=9,45 l');
150
-        (new RoomItem())->store($user->uniqueId, $room->id, 23063, 0, 0, '0', 0, '', ':w=2,10 l=10,56 l');
151
-        (new RoomItem())->store($user->uniqueId, $room->id, 23063, 0, 0, '0', 0, '', ':w=2,11 l=6,58 l');
152
-        (new RoomItem())->store($user->uniqueId, $room->id, 23078, 0, 0, '0', 0, '1', ':w=6,1 l=0,26 r');
153
-        (new RoomItem())->store($user->uniqueId, $room->id, 23078, 0, 0, '0', 0, '3', ':w=7,1 l=4,28 r');
154
-        (new RoomItem())->store($user->uniqueId, $room->id, 23078, 0, 0, '0', 0, '1', ':w=8,1 l=13,33 r');
155
-        (new RoomItem())->store($user->uniqueId, $room->id, 23078, 0, 0, '0', 0, '3', ':w=10,1 l=0,26 r');
156
-        (new RoomItem())->store($user->uniqueId, $room->id, 23229, 0, 0, '0', 0, '1', ':w=4,3 l=6,49 l');
157
-        (new RoomItem())->store($user->uniqueId, $room->id, 23229, 0, 0, '0', 0, '1', ':w=4,5 l=11,45 l');
158
-
159
-        return true;
160
-    }
161
-
162
-    /**
100
+     protected function createPoolRoom(User $user): bool
101
+     {
102
+         $room = (new Room())->store("{$user->name}'s room", "{$user->name} has entered the building", 'model_h', 25, 12, 307, 3104, 1.10, $user->uniqueId, $user->name);
103
+
104
+         $user->update(['home_room' => $room->id]);
105
+
106
+         // Floor Items
107
+         (new RoomItem())->store($user->uniqueId, $room->id, 16715, 5, 11, 1.30000, 0, '');
108
+         (new RoomItem())->store($user->uniqueId, $room->id, 16732, 3, 10, 0.40000, 0, '');
109
+         (new RoomItem())->store($user->uniqueId, $room->id, 17016, 3, 9, 0.00000, 2, '1');
110
+         (new RoomItem())->store($user->uniqueId, $room->id, 17016, 3, 11, 0.00000, 0, '');
111
+         (new RoomItem())->store($user->uniqueId, $room->id, 17016, 4, 9, 0.00000, 4, '');
112
+         (new RoomItem())->store($user->uniqueId, $room->id, 17090, 3, 9, 0.00000, 2, '1');
113
+         (new RoomItem())->store($user->uniqueId, $room->id, 17176, 3, 9, 0.00000, 0, '');
114
+         (new RoomItem())->store($user->uniqueId, $room->id, 17176, 3, 9, 0.40000, 0, '');
115
+         (new RoomItem())->store($user->uniqueId, $room->id, 17176, 3, 10, 0.00000, 0, '');
116
+         (new RoomItem())->store($user->uniqueId, $room->id, 17190, 3, 11, 0.00000, 2, '');
117
+         (new RoomItem())->store($user->uniqueId, $room->id, 17190, 4, 9, 0.00000, 4, '');
118
+         (new RoomItem())->store($user->uniqueId, $room->id, 17191, 3, 10, 0.40000, 2, '');
119
+         (new RoomItem())->store($user->uniqueId, $room->id, 17191, 3, 12, 0.00000, 2, '');
120
+         (new RoomItem())->store($user->uniqueId, $room->id, 17484, 8, 3, 1.00000, 0, '0', 0);
121
+         (new RoomItem())->store($user->uniqueId, $room->id, 17499, 7, 3, 1.00000, 2, '');
122
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 7, 2, 1.00000, 0, '');
123
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 7, 4, 1.00000, 0, '');
124
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 7, 5, 1.00000, 0, '');
125
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 8, 2, 1.00000, 0, '');
126
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 8, 5, 1.00000, 0, '');
127
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 9, 2, 1.00000, 0, '');
128
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 9, 5, 1.00000, 0, '');
129
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 10, 2, 1.00000, 0, '');
130
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 10, 3, 1.00000, 0, '');
131
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 10, 4, 1.00000, 0, '');
132
+         (new RoomItem())->store($user->uniqueId, $room->id, 17520, 10, 5, 1.00000, 0, '');
133
+         (new RoomItem())->store($user->uniqueId, $room->id, 17987, 5, 11, 0.00000, 0, '');
134
+         (new RoomItem())->store($user->uniqueId, $room->id, 18051, 5, 2, 1.00000, 0, '');
135
+         (new RoomItem())->store($user->uniqueId, $room->id, 18051, 5, 4, 1.00000, 0, '');
136
+         (new RoomItem())->store($user->uniqueId, $room->id, 18051, 8, 9, 0.00000, 0, '');
137
+         (new RoomItem())->store($user->uniqueId, $room->id, 18051, 8, 11, 0.00000, 0, '');
138
+         (new RoomItem())->store($user->uniqueId, $room->id, 18051, 9, 9, 0.00000, 0, '');
139
+         (new RoomItem())->store($user->uniqueId, $room->id, 18051, 9, 11, 0.00000, 0, '');
140
+         (new RoomItem())->store($user->uniqueId, $room->id, 18061, 8, 8, 0.00000, 2, '');
141
+         (new RoomItem())->store($user->uniqueId, $room->id, 18061, 8, 9, 0.00000, 6, '1');
142
+         (new RoomItem())->store($user->uniqueId, $room->id, 18061, 10, 8, 0.00000, 4, '1');
143
+         (new RoomItem())->store($user->uniqueId, $room->id, 18070, 8, 2, 1.50000, 0, '1');
144
+         (new RoomItem())->store($user->uniqueId, $room->id, 18079, 9, 8, 0.00000, 0, '1');
145
+         (new RoomItem())->store($user->uniqueId, $room->id, 18363, 3, 9, 0.80000, 0, '2');
146
+
147
+         // Wall Items
148
+         (new RoomItem())->store($user->uniqueId, $room->id, 22996, 0, 0, '0', 0, '', ':w=4,8 l=7,45 r');
149
+         (new RoomItem())->store($user->uniqueId, $room->id, 22996, 0, 0, '0', 0, '', ':w=4,8 l=9,45 l');
150
+         (new RoomItem())->store($user->uniqueId, $room->id, 23063, 0, 0, '0', 0, '', ':w=2,10 l=10,56 l');
151
+         (new RoomItem())->store($user->uniqueId, $room->id, 23063, 0, 0, '0', 0, '', ':w=2,11 l=6,58 l');
152
+         (new RoomItem())->store($user->uniqueId, $room->id, 23078, 0, 0, '0', 0, '1', ':w=6,1 l=0,26 r');
153
+         (new RoomItem())->store($user->uniqueId, $room->id, 23078, 0, 0, '0', 0, '3', ':w=7,1 l=4,28 r');
154
+         (new RoomItem())->store($user->uniqueId, $room->id, 23078, 0, 0, '0', 0, '1', ':w=8,1 l=13,33 r');
155
+         (new RoomItem())->store($user->uniqueId, $room->id, 23078, 0, 0, '0', 0, '3', ':w=10,1 l=0,26 r');
156
+         (new RoomItem())->store($user->uniqueId, $room->id, 23229, 0, 0, '0', 0, '1', ':w=4,3 l=6,49 l');
157
+         (new RoomItem())->store($user->uniqueId, $room->id, 23229, 0, 0, '0', 0, '1', ':w=4,5 l=11,45 l');
158
+
159
+         return true;
160
+     }
161
+
162
+     /**
163 163
      * Create the NUX Club Room.
164 164
      *
165 165
      * @param User $user
166 166
      *
167 167
      * @return bool
168 168
      */
169
-    protected function createClubRoom(User $user): bool
170
-    {
171
-        $room = (new Room())->store("{$user->name}'s room", "{$user->name} has entered the building", 'model_h', 25, 12, 409, 1902, 0.0, $user->uniqueId, $user->name);
172
-
173
-        $user->update(['home_room' => $room->id]);
174
-
175
-        // Floor Items
176
-        (new RoomItem())->store($user->uniqueId, $room->id, 16904, 4, 11, '0.00000', 0, '1');
177
-        (new RoomItem())->store($user->uniqueId, $room->id, 16905, 6, 9, '0.00000', 0, '1');
178
-        (new RoomItem())->store($user->uniqueId, $room->id, 16905, 6, 10, '0.00000', 0, '1');
179
-        (new RoomItem())->store($user->uniqueId, $room->id, 16905, 8, 9, '0.00000', 0, '1');
180
-        (new RoomItem())->store($user->uniqueId, $room->id, 16905, 8, 10, '0.00000', 0, '1');
181
-        (new RoomItem())->store($user->uniqueId, $room->id, 16907, 5, 9, '0.00000', 6, '');
182
-        (new RoomItem())->store($user->uniqueId, $room->id, 16907, 5, 10, '0.00000', 6, '');
183
-        (new RoomItem())->store($user->uniqueId, $room->id, 16909, 4, 9, '0.00000', 2, '1');
184
-        (new RoomItem())->store($user->uniqueId, $room->id, 16909, 4, 10, '0.00000', 2, '1');
185
-        (new RoomItem())->store($user->uniqueId, $room->id, 16913, 6, 7, '1.30000', 0, '3');
186
-        (new RoomItem())->store($user->uniqueId, $room->id, 16913, 9, 7, '1.30000', 0, '3');
187
-        (new RoomItem())->store($user->uniqueId, $room->id, 17189, 10, 2, '1.00000', 0, '');
188
-        (new RoomItem())->store($user->uniqueId, $room->id, 17573, 6, 7, '0.00000', 0, '3');
189
-        (new RoomItem())->store($user->uniqueId, $room->id, 17573, 7, 7, '0.00000', 0, '3');
190
-        (new RoomItem())->store($user->uniqueId, $room->id, 17573, 8, 7, '0.00000', 0, '3');
191
-        (new RoomItem())->store($user->uniqueId, $room->id, 17573, 9, 7, '0.00000', 0, '3');
192
-        (new RoomItem())->store($user->uniqueId, $room->id, 18048, 7, 2, '1.00000', 4, '');
193
-        (new RoomItem())->store($user->uniqueId, $room->id, 18082, 6, 3, '1.00000', 2, '');
194
-        (new RoomItem())->store($user->uniqueId, $room->id, 18082, 9, 3, '1.00000', 6, '');
195
-
196
-        // Wall Items
197
-        (new RoomItem())->store($user->uniqueId, $room->id, 23008, 0, 0, '0', 0, '2', ':w=4,8 l=0,27 r');
198
-        (new RoomItem())->store($user->uniqueId, $room->id, 23013, 0, 0, '0', 0, '', ':w=2,10 l=2,44 l');
199
-        (new RoomItem())->store($user->uniqueId, $room->id, 23014, 0, 0, '0', 0, '1', ':w=8,1 l=14,27 r');
200
-        (new RoomItem())->store($user->uniqueId, $room->id, 23236, 0, 0, '0', 0, '1', ':w=6,1 l=5,31 r');
201
-        (new RoomItem())->store($user->uniqueId, $room->id, 23239, 0, 0, '0', 0, '', ':w=4,7 l=4,29 l');
202
-
203
-        return true;
204
-    }
169
+     protected function createClubRoom(User $user): bool
170
+     {
171
+         $room = (new Room())->store("{$user->name}'s room", "{$user->name} has entered the building", 'model_h', 25, 12, 409, 1902, 0.0, $user->uniqueId, $user->name);
172
+
173
+         $user->update(['home_room' => $room->id]);
174
+
175
+         // Floor Items
176
+         (new RoomItem())->store($user->uniqueId, $room->id, 16904, 4, 11, '0.00000', 0, '1');
177
+         (new RoomItem())->store($user->uniqueId, $room->id, 16905, 6, 9, '0.00000', 0, '1');
178
+         (new RoomItem())->store($user->uniqueId, $room->id, 16905, 6, 10, '0.00000', 0, '1');
179
+         (new RoomItem())->store($user->uniqueId, $room->id, 16905, 8, 9, '0.00000', 0, '1');
180
+         (new RoomItem())->store($user->uniqueId, $room->id, 16905, 8, 10, '0.00000', 0, '1');
181
+         (new RoomItem())->store($user->uniqueId, $room->id, 16907, 5, 9, '0.00000', 6, '');
182
+         (new RoomItem())->store($user->uniqueId, $room->id, 16907, 5, 10, '0.00000', 6, '');
183
+         (new RoomItem())->store($user->uniqueId, $room->id, 16909, 4, 9, '0.00000', 2, '1');
184
+         (new RoomItem())->store($user->uniqueId, $room->id, 16909, 4, 10, '0.00000', 2, '1');
185
+         (new RoomItem())->store($user->uniqueId, $room->id, 16913, 6, 7, '1.30000', 0, '3');
186
+         (new RoomItem())->store($user->uniqueId, $room->id, 16913, 9, 7, '1.30000', 0, '3');
187
+         (new RoomItem())->store($user->uniqueId, $room->id, 17189, 10, 2, '1.00000', 0, '');
188
+         (new RoomItem())->store($user->uniqueId, $room->id, 17573, 6, 7, '0.00000', 0, '3');
189
+         (new RoomItem())->store($user->uniqueId, $room->id, 17573, 7, 7, '0.00000', 0, '3');
190
+         (new RoomItem())->store($user->uniqueId, $room->id, 17573, 8, 7, '0.00000', 0, '3');
191
+         (new RoomItem())->store($user->uniqueId, $room->id, 17573, 9, 7, '0.00000', 0, '3');
192
+         (new RoomItem())->store($user->uniqueId, $room->id, 18048, 7, 2, '1.00000', 4, '');
193
+         (new RoomItem())->store($user->uniqueId, $room->id, 18082, 6, 3, '1.00000', 2, '');
194
+         (new RoomItem())->store($user->uniqueId, $room->id, 18082, 9, 3, '1.00000', 6, '');
195
+
196
+         // Wall Items
197
+         (new RoomItem())->store($user->uniqueId, $room->id, 23008, 0, 0, '0', 0, '2', ':w=4,8 l=0,27 r');
198
+         (new RoomItem())->store($user->uniqueId, $room->id, 23013, 0, 0, '0', 0, '', ':w=2,10 l=2,44 l');
199
+         (new RoomItem())->store($user->uniqueId, $room->id, 23014, 0, 0, '0', 0, '1', ':w=8,1 l=14,27 r');
200
+         (new RoomItem())->store($user->uniqueId, $room->id, 23236, 0, 0, '0', 0, '1', ':w=6,1 l=5,31 r');
201
+         (new RoomItem())->store($user->uniqueId, $room->id, 23239, 0, 0, '0', 0, '', ':w=4,7 l=4,29 l');
202
+
203
+         return true;
204
+     }
205 205
 }
Please login to merge, or discard this patch.
app/Models/UserSecurity.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
      */
60 60
     public function getTrustedDevicesAttribute(): array
61 61
     {
62
-        return TrustedDevice::where('user_id', $this->attributes['user_id'])->get(['ip_address'])->map(function ($item) {
62
+        return TrustedDevice::where('user_id', $this->attributes['user_id'])->get(['ip_address'])->map(function($item) {
63 63
             return $item->ip_address;
64 64
         })->toArray();
65 65
     }
Please login to merge, or discard this patch.
Switch Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,69 +1,69 @@  discard block
 block discarded – undo
1
-<?php
1
+ <?php
2 2
 
3
-namespace App\Models;
3
+ namespace App\Models;
4 4
 
5 5
 /**
6 6
  * Class UserSecurity.
7 7
  */
8
-class UserSecurity extends ChocolateyModel
9
-{
10
-    /**
8
+ class UserSecurity extends ChocolateyModel
9
+ {
10
+     /**
11 11
      * Disable Timestamps.
12 12
      *
13 13
      * @var bool
14 14
      */
15
-    public $timestamps = false;
15
+     public $timestamps = false;
16 16
 
17
-    /**
17
+     /**
18 18
      * The table associated with the model.
19 19
      *
20 20
      * @var string
21 21
      */
22
-    protected $table = 'chocolatey_users_security';
22
+     protected $table = 'chocolatey_users_security';
23 23
 
24
-    /**
24
+     /**
25 25
      * Primary Key of the Table.
26 26
      *
27 27
      * @var string
28 28
      */
29
-    protected $primaryKey = 'user_id';
29
+     protected $primaryKey = 'user_id';
30 30
 
31
-    /**
31
+     /**
32 32
      * The attributes excluded from the model's JSON form.
33 33
      *
34 34
      * @var array
35 35
      */
36
-    protected $hidden = ['user_id'];
36
+     protected $hidden = ['user_id'];
37 37
 
38
-    /**
38
+     /**
39 39
      * The Appender(s) of the Model.
40 40
      *
41 41
      * @var array
42 42
      */
43
-    protected $appends = [
44
-        'trustedDevices',
45
-    ];
43
+     protected $appends = [
44
+         'trustedDevices',
45
+     ];
46 46
 
47
-    /**
47
+     /**
48 48
      * The attributes that are mass assignable.
49 49
      *
50 50
      * @var array
51 51
      */
52
-    protected $fillable = ['user_id', 'firstQuestion', 'secondQuestion', 'firstAnswer', 'secondAnswer'];
52
+     protected $fillable = ['user_id', 'firstQuestion', 'secondQuestion', 'firstAnswer', 'secondAnswer'];
53 53
 
54
-    /**
54
+     /**
55 55
      * Get Trusted Devices.
56 56
      *
57 57
      * @return array
58 58
      */
59
-    public function getTrustedDevicesAttribute(): array
60
-    {
61
-        return TrustedDevice::where('user_id', $this->attributes['user_id'])->get(['ip_address'])->map(function ($item) {
62
-            return $item->ip_address;
63
-        })->toArray();
64
-    }
59
+     public function getTrustedDevicesAttribute(): array
60
+     {
61
+         return TrustedDevice::where('user_id', $this->attributes['user_id'])->get(['ip_address'])->map(function ($item) {
62
+             return $item->ip_address;
63
+         })->toArray();
64
+     }
65 65
 
66
-    /**
66
+     /**
67 67
      * Store a new User Security Metadata.
68 68
      *
69 69
      * @param int    $userId
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
      *
75 75
      * @return UserSecurity
76 76
      */
77
-    public function store(int $userId, int $firstQuestion, int $secondQuestion, string $firstAnswer, string $secondAnswer): UserSecurity
78
-    {
79
-        $this->attributes['user_id'] = $userId;
80
-        $this->attributes['firstQuestion'] = $firstQuestion;
81
-        $this->attributes['secondQuestion'] = $secondQuestion;
82
-        $this->attributes['firstAnswer'] = $firstAnswer;
83
-        $this->attributes['secondAnswer'] = $secondAnswer;
84
-        $this->timestamps = false;
77
+     public function store(int $userId, int $firstQuestion, int $secondQuestion, string $firstAnswer, string $secondAnswer): UserSecurity
78
+     {
79
+         $this->attributes['user_id'] = $userId;
80
+         $this->attributes['firstQuestion'] = $firstQuestion;
81
+         $this->attributes['secondQuestion'] = $secondQuestion;
82
+         $this->attributes['firstAnswer'] = $firstAnswer;
83
+         $this->attributes['secondAnswer'] = $secondAnswer;
84
+         $this->timestamps = false;
85 85
 
86
-        return $this;
87
-    }
86
+         return $this;
87
+     }
88 88
 }
Please login to merge, or discard this patch.
app/Providers/ValidationServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     public function register()
20 20
     {
21
-        $this->app->bind('chocovalidate', function () {
21
+        $this->app->bind('chocovalidate', function() {
22 22
             return Validation::getInstance();
23 23
         });
24 24
     }
Please login to merge, or discard this patch.
app/Http/Controllers/AccountController.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             'block_friendrequests' => $request->json()->get('friendRequestEnabled') == false ? '1' : '0',
79 79
         ]);
80 80
 
81
-        foreach ((array) $request->json()->all() as $setting => $value) {
81
+        foreach ((array)$request->json()->all() as $setting => $value) {
82 82
             UserPreferences::find(UserFacade::getUser()->uniqueId)->update([$setting => $value == true ? '1' : '0']);
83 83
         }
84 84
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
         $token = Mail::store($userInfo['email'], 'public/registration/activate');
146 146
 
147
-        Mail::send(['email' => $userInfo['email'], 'name' => $userName, 'url' => "/activate/{$token}", 'subject' => 'Welcome to '.Config::get('chocolatey.hotelName')]);
147
+        Mail::send(['email' => $userInfo['email'], 'name' => $userName, 'url' => "/activate/{$token}", 'subject' => 'Welcome to ' . Config::get('chocolatey.hotelName')]);
148 148
 
149 149
         return UserFacade::setSession((new User())->store($userName, $userInfo['email'], $request->ip(), $newUser));
150 150
     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     {
163 163
         $partialName = explode(' ', (new Alliteration())->getName());
164 164
 
165
-        return strtolower($partialName[0].strstr($userMail, '@', true).$partialName[1]);
165
+        return strtolower($partialName[0] . strstr($userMail, '@', true) . $partialName[1]);
166 166
     }
167 167
 
168 168
     /**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         $token = Mail::store(UserFacade::getUser()->email, 'public/registration/activate');
212 212
 
213 213
         Mail::send(['name' => UserFacade::getUser()->name, 'email' => $request->user()->email,
214
-            'url'          => "/activate/{$token}", 'subject' => 'Welcome to '.Config::get('chocolatey.hotelName'),
214
+            'url'          => "/activate/{$token}", 'subject' => 'Welcome to ' . Config::get('chocolatey.hotelName'),
215 215
         ]);
216 216
 
217 217
         return response(null);
Please login to merge, or discard this patch.
Switch Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -1,41 +1,41 @@  discard block
 block discarded – undo
1
-<?php
2
-
3
-namespace App\Http\Controllers;
4
-
5
-use App\Facades\Mail;
6
-use App\Facades\User as UserFacade;
7
-use App\Facades\Validation;
8
-use App\Models\ChocolateyId;
9
-use App\Models\User;
10
-use App\Models\UserPreferences;
11
-use App\Models\UserSettings;
12
-use Illuminate\Http\JsonResponse;
13
-use Illuminate\Http\Request;
14
-use Illuminate\Http\Response;
15
-use Illuminate\Support\Facades\Config;
16
-use Laravel\Lumen\Routing\Controller as BaseController;
17
-use Nubs\RandomNameGenerator\Alliteration;
1
+ <?php
2
+
3
+ namespace App\Http\Controllers;
4
+
5
+ use App\Facades\Mail;
6
+ use App\Facades\User as UserFacade;
7
+ use App\Facades\Validation;
8
+ use App\Models\ChocolateyId;
9
+ use App\Models\User;
10
+ use App\Models\UserPreferences;
11
+ use App\Models\UserSettings;
12
+ use Illuminate\Http\JsonResponse;
13
+ use Illuminate\Http\Request;
14
+ use Illuminate\Http\Response;
15
+ use Illuminate\Support\Facades\Config;
16
+ use Laravel\Lumen\Routing\Controller as BaseController;
17
+ use Nubs\RandomNameGenerator\Alliteration;
18 18
 
19 19
 /**
20 20
  * Class AccountController.
21 21
  */
22
-class AccountController extends BaseController
23
-{
24
-    /**
22
+ class AccountController extends BaseController
23
+ {
24
+     /**
25 25
      * Save User Look.
26 26
      *
27 27
      * @param Request $request
28 28
      *
29 29
      * @return JsonResponse
30 30
      */
31
-    public function saveLook(Request $request): JsonResponse
32
-    {
33
-        UserFacade::updateSession(['look' => $request->json()->get('figure'), 'gender' => $request->json()->get('gender')]);
31
+     public function saveLook(Request $request): JsonResponse
32
+     {
33
+         UserFacade::updateSession(['look' => $request->json()->get('figure'), 'gender' => $request->json()->get('gender')]);
34 34
 
35
-        return response()->json(UserFacade::getUser());
36
-    }
35
+         return response()->json(UserFacade::getUser());
36
+     }
37 37
 
38
-    /**
38
+     /**
39 39
      * Get User Non Read Messenger Discussions.
40 40
      *
41 41
      * @TODO: Code Integration with HabboMessenger
@@ -43,59 +43,59 @@  discard block
 block discarded – undo
43 43
      *
44 44
      * @return JsonResponse
45 45
      */
46
-    public function getDiscussions(): JsonResponse
47
-    {
48
-        return response()->json([]);
49
-    }
46
+     public function getDiscussions(): JsonResponse
47
+     {
48
+         return response()->json([]);
49
+     }
50 50
 
51
-    /**
51
+     /**
52 52
      * Get User Preferences.
53 53
      *
54 54
      * @return JsonResponse
55 55
      */
56
-    public function getPreferences(): JsonResponse
57
-    {
58
-        $userPreferences = UserPreferences::firstOrCreate(['user_id' => UserFacade::getUser()->uniqueId]);
56
+     public function getPreferences(): JsonResponse
57
+     {
58
+         $userPreferences = UserPreferences::firstOrCreate(['user_id' => UserFacade::getUser()->uniqueId]);
59 59
 
60
-        foreach ($userPreferences->getAttributes() as $attributeName => $attributeValue) {
61
-            $userPreferences->{$attributeName} = $attributeValue == 1;
62
-        }
60
+         foreach ($userPreferences->getAttributes() as $attributeName => $attributeValue) {
61
+             $userPreferences->{$attributeName} = $attributeValue == 1;
62
+         }
63 63
 
64
-        return response()->json($userPreferences);
65
-    }
64
+         return response()->json($userPreferences);
65
+     }
66 66
 
67
-    /**
67
+     /**
68 68
      * Save New User Preferences.
69 69
      *
70 70
      * @param Request $request
71 71
      *
72 72
      * @return Response
73 73
      */
74
-    public function savePreferences(Request $request): Response
75
-    {
76
-        UserSettings::updateOrCreate(['user_id' => UserFacade::getUser()->uniqueId], [
77
-            'block_following'      => $request->json()->get('friendCanFollow') == false ? '1' : '0',
78
-            'block_friendrequests' => $request->json()->get('friendRequestEnabled') == false ? '1' : '0',
79
-        ]);
74
+     public function savePreferences(Request $request): Response
75
+     {
76
+         UserSettings::updateOrCreate(['user_id' => UserFacade::getUser()->uniqueId], [
77
+             'block_following'      => $request->json()->get('friendCanFollow') == false ? '1' : '0',
78
+             'block_friendrequests' => $request->json()->get('friendRequestEnabled') == false ? '1' : '0',
79
+         ]);
80 80
 
81
-        foreach ((array) $request->json()->all() as $setting => $value) {
82
-            UserPreferences::find(UserFacade::getUser()->uniqueId)->update([$setting => $value == true ? '1' : '0']);
83
-        }
81
+         foreach ((array) $request->json()->all() as $setting => $value) {
82
+             UserPreferences::find(UserFacade::getUser()->uniqueId)->update([$setting => $value == true ? '1' : '0']);
83
+         }
84 84
 
85
-        return response(null);
86
-    }
85
+         return response(null);
86
+     }
87 87
 
88
-    /**
88
+     /**
89 89
      * Get All E-Mail Accounts.
90 90
      *
91 91
      * @return JsonResponse
92 92
      */
93
-    public function getAvatars(): JsonResponse
94
-    {
95
-        return response()->json(UserFacade::getUser()->getChocolateyId()->relatedAccounts);
96
-    }
93
+     public function getAvatars(): JsonResponse
94
+     {
95
+         return response()->json(UserFacade::getUser()->getChocolateyId()->relatedAccounts);
96
+     }
97 97
 
98
-    /**
98
+     /**
99 99
      * Check if an Username is available
100 100
      * for a new Avatar Account.
101 101
      *
@@ -103,33 +103,33 @@  discard block
 block discarded – undo
103 103
      *
104 104
      * @return JsonResponse
105 105
      */
106
-    public function checkName(Request $request): JsonResponse
107
-    {
108
-        return response()->json(['isAvailable' => (User::where('username', $request->input('name'))->count() == 0
109
-            && Validation::filterUserName($request->input('name')) && !UserFacade::getUser()->isStaff)]);
110
-    }
106
+     public function checkName(Request $request): JsonResponse
107
+     {
108
+         return response()->json(['isAvailable' => (User::where('username', $request->input('name'))->count() == 0
109
+             && Validation::filterUserName($request->input('name')) && !UserFacade::getUser()->isStaff)]);
110
+     }
111 111
 
112
-    /**
112
+     /**
113 113
      * Create a New User Avatar.
114 114
      *
115 115
      * @param Request $request
116 116
      *
117 117
      * @return JsonResponse
118 118
      */
119
-    public function createAvatar(Request $request): JsonResponse
120
-    {
121
-        if (User::where('username', $request->json()->get('name'))->count() == 0 && Validation::filterUserName($request->json()->get('name'))) {
122
-            $user = $this->createUser($request, ['username' => $request->json()->get('name'), 'email' => UserFacade::getUser()->email]);
119
+     public function createAvatar(Request $request): JsonResponse
120
+     {
121
+         if (User::where('username', $request->json()->get('name'))->count() == 0 && Validation::filterUserName($request->json()->get('name'))) {
122
+             $user = $this->createUser($request, ['username' => $request->json()->get('name'), 'email' => UserFacade::getUser()->email]);
123 123
 
124
-            ChocolateyId::find(UserFacade::getUser()->email)->update(['last_logged_id' => $user->uniqueId]);
124
+             ChocolateyId::find(UserFacade::getUser()->email)->update(['last_logged_id' => $user->uniqueId]);
125 125
 
126
-            return response()->json('');
127
-        }
126
+             return response()->json('');
127
+         }
128 128
 
129
-        return response()->json('');
130
-    }
129
+         return response()->json('');
130
+     }
131 131
 
132
-    /**
132
+     /**
133 133
      * Create a New User.
134 134
      *
135 135
      * @param Request $request
@@ -138,18 +138,18 @@  discard block
 block discarded – undo
138 138
      *
139 139
      * @return User
140 140
      */
141
-    public function createUser(Request $request, array $userInfo, bool $newUser = false): User
142
-    {
143
-        $userName = $newUser ? $this->uniqueName($userInfo['email']) : $userInfo['username'];
141
+     public function createUser(Request $request, array $userInfo, bool $newUser = false): User
142
+     {
143
+         $userName = $newUser ? $this->uniqueName($userInfo['email']) : $userInfo['username'];
144 144
 
145
-        $token = Mail::store($userInfo['email'], 'public/registration/activate');
145
+         $token = Mail::store($userInfo['email'], 'public/registration/activate');
146 146
 
147
-        Mail::send(['email' => $userInfo['email'], 'name' => $userName, 'url' => "/activate/{$token}", 'subject' => 'Welcome to '.Config::get('chocolatey.hotelName')]);
147
+         Mail::send(['email' => $userInfo['email'], 'name' => $userName, 'url' => "/activate/{$token}", 'subject' => 'Welcome to '.Config::get('chocolatey.hotelName')]);
148 148
 
149
-        return UserFacade::setSession((new User())->store($userName, $userInfo['email'], $request->ip(), $newUser));
150
-    }
149
+         return UserFacade::setSession((new User())->store($userName, $userInfo['email'], $request->ip(), $newUser));
150
+     }
151 151
 
152
-    /**
152
+     /**
153 153
      * Create Random Unique Username.
154 154
      *
155 155
      * @WARNING: Doesn't create Like Habbo Way
@@ -158,62 +158,62 @@  discard block
 block discarded – undo
158 158
      *
159 159
      * @return string
160 160
      */
161
-    protected function uniqueName(string $userMail): string
162
-    {
163
-        $partialName = explode(' ', (new Alliteration())->getName());
161
+     protected function uniqueName(string $userMail): string
162
+     {
163
+         $partialName = explode(' ', (new Alliteration())->getName());
164 164
 
165
-        return strtolower($partialName[0].strstr($userMail, '@', true).$partialName[1]);
166
-    }
165
+         return strtolower($partialName[0].strstr($userMail, '@', true).$partialName[1]);
166
+     }
167 167
 
168
-    /**
168
+     /**
169 169
      * Change Logged In User.
170 170
      *
171 171
      * @param Request $request
172 172
      */
173
-    public function selectAvatar(Request $request)
174
-    {
175
-        UserFacade::getUser()->getChocolateyId()->update(['last_logged_id' => $request->json()->get('uniqueId')]);
173
+     public function selectAvatar(Request $request)
174
+     {
175
+         UserFacade::getUser()->getChocolateyId()->update(['last_logged_id' => $request->json()->get('uniqueId')]);
176 176
 
177
-        UserFacade::setSession(User::find($request->json()->get('uniqueId')));
178
-    }
177
+         UserFacade::setSession(User::find($request->json()->get('uniqueId')));
178
+     }
179 179
 
180
-    /**
180
+     /**
181 181
      * Send User Forgot E-Mail.
182 182
      *
183 183
      * @param Request $request
184 184
      *
185 185
      * @return JsonResponse
186 186
      */
187
-    public function forgotPassword(Request $request): JsonResponse
188
-    {
189
-        if (($user = User::where('mail', $request->json()->get('email'))->first()) == null) {
190
-            return response()->json(['email' => $request->json()->get('email')]);
191
-        }
187
+     public function forgotPassword(Request $request): JsonResponse
188
+     {
189
+         if (($user = User::where('mail', $request->json()->get('email'))->first()) == null) {
190
+             return response()->json(['email' => $request->json()->get('email')]);
191
+         }
192 192
 
193
-        $token = Mail::store($user->email, 'public/forgotPassword');
193
+         $token = Mail::store($user->email, 'public/forgotPassword');
194 194
 
195
-        Mail::send(['name' => $user->name, 'email' => $user->email, 'subject' => 'Password reset confirmation',
196
-            'url'          => "/reset-password/{$token}",
197
-        ], 'habbo-web-mail.password-reset');
195
+         Mail::send(['name' => $user->name, 'email' => $user->email, 'subject' => 'Password reset confirmation',
196
+             'url'          => "/reset-password/{$token}",
197
+         ], 'habbo-web-mail.password-reset');
198 198
 
199
-        return response()->json(['email' => $user->email]);
200
-    }
199
+         return response()->json(['email' => $user->email]);
200
+     }
201 201
 
202
-    /**
202
+     /**
203 203
      * Send an Account Confirmation E-Mail.
204 204
      *
205 205
      * @param Request $request
206 206
      *
207 207
      * @return Response
208 208
      */
209
-    public function verifyAccount(Request $request): Response
210
-    {
211
-        $token = Mail::store(UserFacade::getUser()->email, 'public/registration/activate');
209
+     public function verifyAccount(Request $request): Response
210
+     {
211
+         $token = Mail::store(UserFacade::getUser()->email, 'public/registration/activate');
212 212
 
213
-        Mail::send(['name' => UserFacade::getUser()->name, 'email' => $request->user()->email,
214
-            'url'          => "/activate/{$token}", 'subject' => 'Welcome to '.Config::get('chocolatey.hotelName'),
215
-        ]);
213
+         Mail::send(['name' => UserFacade::getUser()->name, 'email' => $request->user()->email,
214
+             'url'          => "/activate/{$token}", 'subject' => 'Welcome to '.Config::get('chocolatey.hotelName'),
215
+         ]);
216 216
 
217
-        return response(null);
218
-    }
217
+         return response(null);
218
+     }
219 219
 }
Please login to merge, or discard this patch.
app/Models/Photo.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function getIdAttribute(): string
56 56
     {
57
-        return (string) $this->attributes['id'];
57
+        return (string)$this->attributes['id'];
58 58
     }
59 59
 
60 60
     /**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function getLikesAttribute(): array
108 108
     {
109
-        return array_map(function (array $item) {
109
+        return array_map(function(array $item) {
110 110
             return $item['username'];
111 111
         }, PhotoLike::query()->select('username')->where('photo_id', $this->attributes['id'])->get(['username'])->toArray());
112 112
     }
Please login to merge, or discard this patch.
Switch Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -1,145 +1,145 @@
 block discarded – undo
1
-<?php
1
+ <?php
2 2
 
3
-namespace App\Models;
3
+ namespace App\Models;
4 4
 
5
-use Sofa\Eloquence\Eloquence;
6
-use Sofa\Eloquence\Mappable;
5
+ use Sofa\Eloquence\Eloquence;
6
+ use Sofa\Eloquence\Mappable;
7 7
 
8 8
 /**
9 9
  * Class Photo.
10 10
  */
11
-class Photo extends ChocolateyModel
12
-{
13
-    use Eloquence, Mappable;
11
+ class Photo extends ChocolateyModel
12
+ {
13
+     use Eloquence, Mappable;
14 14
 
15
-    /**
15
+     /**
16 16
      * The table associated with the model.
17 17
      *
18 18
      * @var string
19 19
      */
20
-    protected $table = 'camera_web';
20
+     protected $table = 'camera_web';
21 21
 
22
-    /**
22
+     /**
23 23
      * Primary Key of the Table.
24 24
      *
25 25
      * @var string
26 26
      */
27
-    protected $primaryKey = 'id';
27
+     protected $primaryKey = 'id';
28 28
 
29
-    /**
29
+     /**
30 30
      * The attributes that will be mapped.
31 31
      *
32 32
      * @var array
33 33
      */
34
-    protected $maps = ['creator_id' => 'user_id', 'previewUrl' => 'url', 'creator_uniqueId' => 'user_id', 'time' => 'timestamp'];
34
+     protected $maps = ['creator_id' => 'user_id', 'previewUrl' => 'url', 'creator_uniqueId' => 'user_id', 'time' => 'timestamp'];
35 35
 
36
-    /**
36
+     /**
37 37
      * The Appender(s) of the Model.
38 38
      *
39 39
      * @var array
40 40
      */
41
-    protected $appends = ['creator_uniqueId', 'version', 'previewUrl', 'creator_id', 'likes', 'tags', 'version', 'type', 'room_id', 'creator_name'];
41
+     protected $appends = ['creator_uniqueId', 'version', 'previewUrl', 'creator_id', 'likes', 'tags', 'version', 'type', 'room_id', 'creator_name'];
42 42
 
43
-    /**
43
+     /**
44 44
      * The attributes that should be casted to native types.
45 45
      *
46 46
      * @var array
47 47
      */
48
-    protected $casts = ['tags' => 'array', 'creator_uniqueId' => 'string'];
48
+     protected $casts = ['tags' => 'array', 'creator_uniqueId' => 'string'];
49 49
 
50
-    /**
50
+     /**
51 51
      * Get the Unique Id of the Photo.
52 52
      *
53 53
      * @return string
54 54
      */
55
-    public function getIdAttribute(): string
56
-    {
57
-        return (string) $this->attributes['id'];
58
-    }
55
+     public function getIdAttribute(): string
56
+     {
57
+         return (string) $this->attributes['id'];
58
+     }
59 59
 
60
-    /**
60
+     /**
61 61
      * Get the URL of the Photo.
62 62
      *
63 63
      * @return string
64 64
      */
65
-    public function getUrlAttribute(): string
66
-    {
67
-        return str_replace('http:', '', str_replace('https:', '', $this->attributes['url']));
68
-    }
65
+     public function getUrlAttribute(): string
66
+     {
67
+         return str_replace('http:', '', str_replace('https:', '', $this->attributes['url']));
68
+     }
69 69
 
70
-    /**
70
+     /**
71 71
      * Get the Version Attribute.
72 72
      *
73 73
      * @return int
74 74
      */
75
-    public function getVersionAttribute(): int
76
-    {
77
-        return 1;
78
-    }
75
+     public function getVersionAttribute(): int
76
+     {
77
+         return 1;
78
+     }
79 79
 
80
-    /**
80
+     /**
81 81
      * Get All Tags
82 82
      * Transforming it on an Array.
83 83
      *
84 84
      * @return array(string)
85 85
      */
86
-    public function getTagsAttribute(): array
87
-    {
88
-        return [];
89
-    }
86
+     public function getTagsAttribute(): array
87
+     {
88
+         return [];
89
+     }
90 90
 
91
-    /**
91
+     /**
92 92
      * Get Formatted Time
93 93
      * Convert Date to UNIX Timestamp.
94 94
      *
95 95
      * @return int
96 96
      */
97
-    public function getTimeAttribute(): int
98
-    {
99
-        return strtotime($this->attributes['timestamp']) * 1000;
100
-    }
97
+     public function getTimeAttribute(): int
98
+     {
99
+         return strtotime($this->attributes['timestamp']) * 1000;
100
+     }
101 101
 
102
-    /**
102
+     /**
103 103
      * Get Photo Likes Directly as Username.
104 104
      *
105 105
      * @return array
106 106
      */
107
-    public function getLikesAttribute(): array
108
-    {
109
-        return array_map(function (array $item) {
110
-            return $item['username'];
111
-        }, PhotoLike::query()->select('username')->where('photo_id', $this->attributes['id'])->get(['username'])->toArray());
112
-    }
113
-
114
-    /**
107
+     public function getLikesAttribute(): array
108
+     {
109
+         return array_map(function (array $item) {
110
+             return $item['username'];
111
+         }, PhotoLike::query()->select('username')->where('photo_id', $this->attributes['id'])->get(['username'])->toArray());
112
+     }
113
+
114
+     /**
115 115
      * Get the Photo Type Attribute.
116 116
      *
117 117
      * @return string
118 118
      */
119
-    public function getTypeAttribute(): string
120
-    {
121
-        return 'PHOTO';
122
-    }
119
+     public function getTypeAttribute(): string
120
+     {
121
+         return 'PHOTO';
122
+     }
123 123
 
124
-    /**
124
+     /**
125 125
      * Get Room Id.
126 126
      *
127 127
      * @TODO: Add real RoomID
128 128
      *
129 129
      * @return int
130 130
      */
131
-    public function getRoomIdAttribute(): int
132
-    {
133
-        return 1;
134
-    }
131
+     public function getRoomIdAttribute(): int
132
+     {
133
+         return 1;
134
+     }
135 135
 
136
-    /**
136
+     /**
137 137
      * Get User Name.
138 138
      *
139 139
      * @return string
140 140
      */
141
-    public function getCreatorNameAttribute(): string
142
-    {
143
-        return User::find($this->attributes['user_id'])->name;
144
-    }
141
+     public function getCreatorNameAttribute(): string
142
+     {
143
+         return User::find($this->attributes['user_id'])->name;
144
+     }
145 145
 }
Please login to merge, or discard this patch.
app/Helpers/Validation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      */
47 47
     public function checkWords(string $needle): bool
48 48
     {
49
-        return count(array_filter(Config::get('chocolatey.invalid'), function ($illegal) use ($needle) {
49
+        return count(array_filter(Config::get('chocolatey.invalid'), function($illegal) use ($needle) {
50 50
             return stripos($needle, $illegal) !== false;
51 51
         })) == 0;
52 52
     }
Please login to merge, or discard this patch.