Completed
Push — master ( 40695f...382c3d )
by Nicolas
05:52 queued 02:19
created
Database/Migrations/2015_11_17_154243_create_notifications_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function up()
13 13
     {
14
-        Schema::create('notification__notifications', function (Blueprint $table) {
14
+        Schema::create('notification__notifications', function(Blueprint $table) {
15 15
             $table->increments('id');
16 16
             $table->integer('user_id')->unsigned();
17 17
             $table->string('type')->nullable();
Please login to merge, or discard this patch.
Entities/Notification.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 class Notification extends Model
17 17
 {
18 18
     protected $table = 'notification__notifications';
19
-    protected $fillable = ['user_id', 'type', 'message', 'icon_class', 'link', 'is_read', 'title'];
20
-    protected $appends = ['time_ago'];
19
+    protected $fillable = [ 'user_id', 'type', 'message', 'icon_class', 'link', 'is_read', 'title' ];
20
+    protected $appends = [ 'time_ago' ];
21 21
 
22 22
     /**
23 23
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
Please login to merge, or discard this patch.
Events/BroadcastNotification.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
      */
26 26
     public function broadcastOn()
27 27
     {
28
-        return ['asgardcms.notifications.' . $this->notification->user_id];
28
+        return [ 'asgardcms.notifications.' . $this->notification->user_id ];
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
Http/Controllers/Admin/NotificationsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     {
42 42
         $this->notification->destroy($notification);
43 43
 
44
-        flash(trans('core::core.messages.resource deleted', ['name' => 'Notification']));
44
+        flash(trans('core::core.messages.resource deleted', [ 'name' => 'Notification' ]));
45 45
 
46 46
         return redirect()->route('admin.notification.notification.index');
47 47
     }
Please login to merge, or discard this patch.
Http/apiRoutes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-post('notification/mark-read', ['as' => 'api.notification.read', 'uses' => 'NotificationsController@markAsRead']);
3
+post('notification/mark-read', [ 'as' => 'api.notification.read', 'uses' => 'NotificationsController@markAsRead' ]);
Please login to merge, or discard this patch.
Http/backendRoutes.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$router->group(['prefix' => '/notification'], function () {
4
-    get('notifications', ['as' => 'admin.notification.notification.index', 'uses' => 'NotificationsController@index']);
5
-    get('notifications/markAllAsRead', ['as' => 'admin.notification.notification.markAllAsRead', 'uses' => 'NotificationsController@markAllAsRead']);
6
-    delete('notifications/destroyAll', ['as' => 'admin.notification.notification.destroyAll', 'uses' => 'NotificationsController@destroyAll']);
7
-    delete('notifications/{notification}', ['as' => 'admin.notification.notification.destroy', 'uses' => 'NotificationsController@destroy']);
3
+$router->group([ 'prefix' => '/notification' ], function() {
4
+    get('notifications', [ 'as' => 'admin.notification.notification.index', 'uses' => 'NotificationsController@index' ]);
5
+    get('notifications/markAllAsRead', [ 'as' => 'admin.notification.notification.markAllAsRead', 'uses' => 'NotificationsController@markAllAsRead' ]);
6
+    delete('notifications/destroyAll', [ 'as' => 'admin.notification.notification.destroyAll', 'uses' => 'NotificationsController@destroyAll' ]);
7
+    delete('notifications/{notification}', [ 'as' => 'admin.notification.notification.destroy', 'uses' => 'NotificationsController@destroy' ]);
8 8
 });
Please login to merge, or discard this patch.
Providers/NotificationServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 
42 42
     private function registerBindings()
43 43
     {
44
-        $this->app->bind(NotificationRepository::class, function () {
44
+        $this->app->bind(NotificationRepository::class, function() {
45 45
                 $repository = new EloquentNotificationRepository(new Notification());
46 46
 
47
-                if (! config('app.cache')) {
47
+                if (!config('app.cache')) {
48 48
                     return $repository;
49 49
                 }
50 50
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
             }
53 53
         );
54 54
 
55
-        $this->app->bind(\Modules\Notification\Services\Notification::class, function ($app) {
56
-            return new AsgardNotification($app[NotificationRepository::class], $app[Authentication::class]);
55
+        $this->app->bind(\Modules\Notification\Services\Notification::class, function($app) {
56
+            return new AsgardNotification($app[ NotificationRepository::class ], $app[ Authentication::class ]);
57 57
         });
58 58
     }
59 59
 
Please login to merge, or discard this patch.
Repositories/Cache/CacheNotificationDecorator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         return $this->cache
22 22
             ->tags($this->entityName, 'global')
23 23
             ->remember("{$this->locale}.{$this->entityName}.latestForUser.{$userId}", $this->cacheTime,
24
-                function () use ($userId) {
24
+                function() use ($userId) {
25 25
                     return $this->repository->latestForUser($userId);
26 26
                 }
27 27
             );
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         return $this->cache
50 50
             ->tags($this->entityName, 'global')
51 51
             ->remember("{$this->locale}.{$this->entityName}.allForUser.{$userId}", $this->cacheTime,
52
-                function () use ($userId) {
52
+                function() use ($userId) {
53 53
                     return $this->repository->allForUser($userId);
54 54
                 }
55 55
             );
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         return $this->cache
66 66
             ->tags($this->entityName, 'global')
67 67
             ->remember("{$this->locale}.{$this->entityName}.allUnreadForUser.{$userId}", $this->cacheTime,
68
-                function () use ($userId) {
68
+                function() use ($userId) {
69 69
                     return $this->repository->allUnreadForUser($userId);
70 70
                 }
71 71
             );
Please login to merge, or discard this patch.
Repositories/Eloquent/EloquentNotificationRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,6 +74,6 @@
 block discarded – undo
74 74
      */
75 75
     public function markAllAsReadForUser($userId)
76 76
     {
77
-        return $this->model->whereUserId($userId)->update(['is_read' => true]);
77
+        return $this->model->whereUserId($userId)->update([ 'is_read' => true ]);
78 78
     }
79 79
 }
Please login to merge, or discard this patch.