@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | |
24 | 24 | private function registerUserstamps() |
25 | 25 | { |
26 | - Blueprint::macro('userstamps', function () { |
|
27 | - if (config('userstamps.users_table_column_type') === 'bigIncrements') { |
|
26 | + Blueprint::macro('userstamps', function() { |
|
27 | + if ( config('userstamps.users_table_column_type') === 'bigIncrements' ) { |
|
28 | 28 | $this->unsignedBigInteger(config('userstamps.created_by_column'))->nullable(); |
29 | 29 | $this->unsignedBigInteger(config('userstamps.updated_by_column'))->nullable(); |
30 | - } elseif (config('userstamps.users_table_column_type') === 'uuid') { |
|
30 | + } elseif ( config('userstamps.users_table_column_type') === 'uuid' ) { |
|
31 | 31 | $this->uuid(config('userstamps.created_by_column'))->nullable(); |
32 | 32 | $this->uuid(config('userstamps.updated_by_column'))->nullable(); |
33 | - } elseif (config('userstamps.users_table_column_type') === 'ulid') { |
|
33 | + } elseif ( config('userstamps.users_table_column_type') === 'ulid' ) { |
|
34 | 34 | $this->ulid(config('userstamps.created_by_column'))->nullable(); |
35 | 35 | $this->ulid(config('userstamps.updated_by_column'))->nullable(); |
36 | 36 | } else { |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | |
55 | 55 | private function registerSoftUserstamps() |
56 | 56 | { |
57 | - Blueprint::macro('softUserstamps', function () { |
|
58 | - if (config('userstamps.users_table_column_type') === 'bigIncrements') { |
|
57 | + Blueprint::macro('softUserstamps', function() { |
|
58 | + if ( config('userstamps.users_table_column_type') === 'bigIncrements' ) { |
|
59 | 59 | $this->unsignedBigInteger(config('userstamps.deleted_by_column'))->nullable(); |
60 | - } elseif (config('userstamps.users_table_column_type') === 'uuid') { |
|
60 | + } elseif ( config('userstamps.users_table_column_type') === 'uuid' ) { |
|
61 | 61 | $this->uuid(config('userstamps.deleted_by_column'))->nullable(); |
62 | - } elseif (config('userstamps.users_table_column_type') === 'uuid') { |
|
62 | + } elseif ( config('userstamps.users_table_column_type') === 'uuid' ) { |
|
63 | 63 | $this->ulid(config('userstamps.deleted_by_column'))->nullable(); |
64 | 64 | } else { |
65 | 65 | $this->unsignedInteger(config('userstamps.deleted_by_column'))->nullable(); |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | |
77 | 77 | private function registerDropUserstamps() |
78 | 78 | { |
79 | - Blueprint::macro('dropUserstamps', function () { |
|
80 | - if (! DB::connection() instanceof SQLiteConnection) { |
|
79 | + Blueprint::macro('dropUserstamps', function() { |
|
80 | + if ( !DB::connection() instanceof SQLiteConnection ) { |
|
81 | 81 | $this->dropForeign([ |
82 | 82 | config('userstamps.created_by_column'), |
83 | 83 | ]); |
84 | 84 | } |
85 | 85 | |
86 | - if (! DB::connection() instanceof SQLiteConnection) { |
|
86 | + if ( !DB::connection() instanceof SQLiteConnection ) { |
|
87 | 87 | $this->dropForeign([ |
88 | 88 | config('userstamps.updated_by_column'), |
89 | 89 | ]); |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | |
99 | 99 | private function registerDropSoftUserstamps() |
100 | 100 | { |
101 | - Blueprint::macro('dropSoftUserstamps', function () { |
|
102 | - if (! DB::connection() instanceof SQLiteConnection) { |
|
101 | + Blueprint::macro('dropSoftUserstamps', function() { |
|
102 | + if ( !DB::connection() instanceof SQLiteConnection ) { |
|
103 | 103 | $this->dropForeign([ |
104 | 104 | config('userstamps.deleted_by_column'), |
105 | 105 | ]); |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function creating(Model $model) |
17 | 17 | { |
18 | - if ($model->isClean(config('userstamps.created_by_column'))) { |
|
18 | + if ( $model->isClean(config('userstamps.created_by_column')) ) { |
|
19 | 19 | $model->{config('userstamps.created_by_column')} = $this->getUsersPrimaryValue(); |
20 | 20 | } |
21 | 21 | |
22 | - if ($model->isClean(config('userstamps.updated_by_column'))) { |
|
22 | + if ( $model->isClean(config('userstamps.updated_by_column')) ) { |
|
23 | 23 | $model->{config('userstamps.updated_by_column')} = $this->getUsersPrimaryValue(); |
24 | 24 | } |
25 | 25 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function updating(Model $model) |
34 | 34 | { |
35 | - if ($model->isClean(config('userstamps.updated_by_column'))) { |
|
35 | + if ( $model->isClean(config('userstamps.updated_by_column')) ) { |
|
36 | 36 | $model->{config('userstamps.updated_by_column')} = $this->getUsersPrimaryValue(); |
37 | 37 | } |
38 | 38 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function deleting(Model $model) |
47 | 47 | { |
48 | - if ($model->usingSoftDeletes()) { |
|
48 | + if ( $model->usingSoftDeletes() ) { |
|
49 | 49 | $model->{config('userstamps.deleted_by_column')} = $this->getUsersPrimaryValue(); |
50 | 50 | $model->{config('userstamps.updated_by_column')} = $this->getUsersPrimaryValue(); |
51 | 51 | $this->saveWithoutEventDispatching($model); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function restoring(Model $model) |
62 | 62 | { |
63 | - if ($model->usingSoftDeletes()) { |
|
63 | + if ( $model->usingSoftDeletes() ) { |
|
64 | 64 | $model->{config('userstamps.deleted_by_column')} = null; |
65 | 65 | $model->{config('userstamps.updated_by_column')} = $this->getUsersPrimaryValue(); |
66 | 66 | $this->saveWithoutEventDispatching($model); |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | */ |
93 | 93 | private function getUsersPrimaryValue() |
94 | 94 | { |
95 | - if (! Auth::check()) { |
|
95 | + if ( !Auth::check() ) { |
|
96 | 96 | return null; |
97 | 97 | } |
98 | 98 | |
99 | - if (config('userstamps.users_table_column_id_name') !== 'id') { |
|
99 | + if ( config('userstamps.users_table_column_id_name') !== 'id' ) { |
|
100 | 100 | return Auth::user()->{config('userstamps.users_table_column_id_name')}; |
101 | 101 | } |
102 | 102 |