Completed
Push — master ( 3cc6f9...dcc039 )
by Joao
02:23
created
src/Traits/Creation.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     {
14 14
 
15 15
         // create a event to happen on deleting
16
-        static::deleting(function($table)  {
16
+        static::deleting(function($table) {
17 17
             if (class_exists('Cartalyst\Sentinel\Laravel\Facades\Sentinel'))
18 18
                 $table->deleted_by = Sentinel::getUser()->id;
19 19
             else
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         });
22 22
 
23 23
         // create a event to happen on saving
24
-        static::saving(function($table)  {
24
+        static::saving(function($table) {
25 25
 
26 26
             if (class_exists('Cartalyst\Sentinel\Laravel\Facades\Sentinel'))
27 27
             {
Please login to merge, or discard this patch.
Braces   +12 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,10 +14,11 @@  discard block
 block discarded – undo
14 14
 
15 15
         // create a event to happen on deleting
16 16
         static::deleting(function($table)  {
17
-            if (class_exists('Cartalyst\Sentinel\Laravel\Facades\Sentinel'))
18
-                $table->deleted_by = Sentinel::getUser()->id;
19
-            else
20
-                $table->deleted_by = Auth::user()->id;
17
+            if (class_exists('Cartalyst\Sentinel\Laravel\Facades\Sentinel')) {
18
+                            $table->deleted_by = Sentinel::getUser()->id;
19
+            } else {
20
+                            $table->deleted_by = Auth::user()->id;
21
+            }
21 22
         });
22 23
 
23 24
         // create a event to happen on saving
@@ -27,15 +28,16 @@  discard block
 block discarded – undo
27 28
             {
28 29
                 $table->modified_by = Sentinel::getUser()->id;
29 30
 
30
-                if ($user = Sentinel::check() && ($table->created_by == null || !($table->created_by > 0)))
31
-                    $table->created_by = Sentinel::getUser()->id;
32
-            }
33
-            else
31
+                if ($user = Sentinel::check() && ($table->created_by == null || !($table->created_by > 0))) {
32
+                                    $table->created_by = Sentinel::getUser()->id;
33
+                }
34
+            } else
34 35
             {
35 36
                 $table->modified_by = Auth::user()->id;
36 37
 
37
-                if (!Auth::guest() && ($table->created_by == null || !($table->created_by > 0)))
38
-                    $table->created_by = Auth::user()->id;
38
+                if (!Auth::guest() && ($table->created_by == null || !($table->created_by > 0))) {
39
+                                    $table->created_by = Auth::user()->id;
40
+                }
39 41
             }
40 42
 
41 43
         });
Please login to merge, or discard this patch.