@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $this->artisan('cache:clear'); |
| 24 | 24 | $this->artisan('db:seed'); |
| 25 | 25 | |
| 26 | - $this->beforeApplicationDestroyed(function () { |
|
| 26 | + $this->beforeApplicationDestroyed(function() { |
|
| 27 | 27 | $this->artisan('cache:clear'); |
| 28 | 28 | $this->artisan('migrate:rollback'); |
| 29 | 29 | RefreshDatabaseState::$migrated = false; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public function getUserByUserInfo($userInfo) |
| 45 | 45 | { |
| 46 | - return $this->upsertUser($userInfo['profile']); |
|
| 46 | + return $this->upsertUser($userInfo[ 'profile' ]); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | protected function upsertUser($profile) |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | throw new BadRequestHttpException('Missing token information: Auth0 user id is not set'); |
| 53 | 53 | } |
| 54 | 54 | $identifier = explode('|', $profile->user_id); |
| 55 | - $identityProvider = $identifier[0]; |
|
| 56 | - $id = $identifier[1]; |
|
| 55 | + $identityProvider = $identifier[ 0 ]; |
|
| 56 | + $id = $identifier[ 1 ]; |
|
| 57 | 57 | |
| 58 | 58 | $user = $this->service->find($id); |
| 59 | 59 | $newUser = false; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | public function broadcastOn() |
| 36 | 36 | { |
| 37 | - return new PrivateChannel('app.' . $this->user->getKey()); |
|
| 37 | + return new PrivateChannel('app.'.$this->user->getKey()); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -28,8 +28,9 @@ |
||
| 28 | 28 | { |
| 29 | 29 | $notification = get_authenticated_user()->unreadNotifications()->find($id); |
| 30 | 30 | |
| 31 | - if ($notification === null) |
|
| 32 | - throw new NotFoundHttpException("Could not find notification"); |
|
| 31 | + if ($notification === null) { |
|
| 32 | + throw new NotFoundHttpException("Could not find notification"); |
|
| 33 | + } |
|
| 33 | 34 | |
| 34 | 35 | $notification->markAsRead(); |
| 35 | 36 | return response()->json([ |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | class WebNotificationCreatedEvent extends BroadcastNotificationCreated |
| 15 | 15 | { |
| 16 | - public function broadcastAs(){ |
|
| 16 | + public function broadcastAs() { |
|
| 17 | 17 | return 'notification.created'; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $this->assertCount(1, $notifications); |
| 36 | 36 | $notification = $user->unreadNotifications()->first(); |
| 37 | 37 | $notificationId = $notification->getKey(); |
| 38 | - $response = $this->http('POST', 'v1/notifications/' . $notificationId); |
|
| 38 | + $response = $this->http('POST', 'v1/notifications/'.$notificationId); |
|
| 39 | 39 | $response->assertStatus(200); |
| 40 | 40 | $unreadnotifications = User::find($user->getKey())->unreadNotifications; |
| 41 | 41 | $this->assertCount(0, $unreadnotifications); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $response->assertStatus(200); |
| 51 | 51 | $notificationsReponse = $this->decodeHttpContent($response->getContent()); |
| 52 | 52 | $notifications = NotificationResource::collection(User::find($user->getKey())->notifications)->jsonSerialize(); |
| 53 | - $this->assertEquals($notificationsReponse, (array)$notifications); |
|
| 53 | + $this->assertEquals($notificationsReponse, (array) $notifications); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function testUnreadNotificationsRoute() |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $user->notifyNow(new UserRegisteredNotification($user)); |
| 60 | 60 | $notification = $user->unreadNotifications()->first(); |
| 61 | 61 | $notificationId = $notification->getKey(); |
| 62 | - $response = $this->http('POST', 'v1/notifications/' . $notificationId); |
|
| 62 | + $response = $this->http('POST', 'v1/notifications/'.$notificationId); |
|
| 63 | 63 | $response->assertStatus(200); |
| 64 | 64 | $response = $this->http('GET', 'v1/notifications/unread'); |
| 65 | 65 | $response->assertStatus(200); |