@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function deleting(Model $model) |
40 | 40 | { |
41 | - if ($model->usingSoftDeletes()) { |
|
41 | + if ( $model->usingSoftDeletes() ) { |
|
42 | 42 | $model->{config('userstamps.deleted_by_column')} = $this->getUsersPrimaryValue(); |
43 | 43 | $model->{config('userstamps.updated_by_column')} = $this->getUsersPrimaryValue(); |
44 | 44 | $this->saveWithoutEventDispatching($model); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function restoring(Model $model) |
55 | 55 | { |
56 | - if ($model->usingSoftDeletes()) { |
|
56 | + if ( $model->usingSoftDeletes() ) { |
|
57 | 57 | $model->{config('userstamps.deleted_by_column')} = null; |
58 | 58 | $model->{config('userstamps.updated_by_column')} = $this->getUsersPrimaryValue(); |
59 | 59 | $this->saveWithoutEventDispatching($model); |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | */ |
86 | 86 | private function getUsersPrimaryValue() |
87 | 87 | { |
88 | - if (! Auth::check()) { |
|
88 | + if ( !Auth::check() ) { |
|
89 | 89 | return null; |
90 | 90 | } |
91 | 91 | |
92 | - if (config('userstamps.users_table_column_id_name') !== 'id') { |
|
92 | + if ( config('userstamps.users_table_column_id_name') !== 'id' ) { |
|
93 | 93 | return Auth::user()->{config('userstamps.users_table_column_id_name')}; |
94 | 94 | } |
95 | 95 |
@@ -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') === 'ulid') { |
|
62 | + } elseif ( config('userstamps.users_table_column_type') === 'ulid' ) { |
|
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 | ]); |