@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('organizations', function (Blueprint $table) { |
|
16 | + Schema::create('organizations', function(Blueprint $table) { |
|
17 | 17 | $table->increments('organization_id'); |
18 | 18 | $table->string('name')->unique(); |
19 | 19 | $table->timestamps(); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function up() |
13 | 13 | { |
14 | - Schema::create('binary_users', function (Blueprint $table) { |
|
14 | + Schema::create('binary_users', function(Blueprint $table) { |
|
15 | 15 | $table->binary('user_id'); |
16 | 16 | $table->unsignedInteger('organization_id'); |
17 | 17 | $table->primary(['user_id', 'organization_id']); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('non_composite_users', function (Blueprint $table) { |
|
16 | + Schema::create('non_composite_users', function(Blueprint $table) { |
|
17 | 17 | $table->increments('user_id'); |
18 | 18 | $table->unsignedInteger('organization_id'); |
19 | 19 | $table->string('name')->unique(); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | protected function getEnvironmentSetUp($app) |
12 | 12 | { |
13 | 13 | $app['config']->set('database.default', 'testing'); |
14 | - $app['router']->get('binary-users/{binaryUser}', function (TestBinaryUser $binaryUser) { |
|
14 | + $app['router']->get('binary-users/{binaryUser}', function(TestBinaryUser $binaryUser) { |
|
15 | 15 | return $binaryUser->toJson(); |
16 | 16 | })->middleware(SubstituteBindings::class); |
17 | 17 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | protected function getEnvironmentSetUp($app) |
12 | 12 | { |
13 | 13 | $app['config']->set('database.default', 'testing'); |
14 | - $app['router']->get('non-composite-users/{testUserNonComposite}', function (TestUserNonComposite $testUserNonComposite) { |
|
14 | + $app['router']->get('non-composite-users/{testUserNonComposite}', function(TestUserNonComposite $testUserNonComposite) { |
|
15 | 15 | return $testUserNonComposite->setHidden(['created_at', 'updated_at'])->toJson(); |
16 | 16 | })->middleware(SubstituteBindings::class); |
17 | 17 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function up() |
13 | 13 | { |
14 | - Schema::create('users', function (Blueprint $table) { |
|
14 | + Schema::create('users', function(Blueprint $table) { |
|
15 | 15 | //primary |
16 | 16 | $table->unsignedInteger('user_id'); |
17 | 17 | $table->unsignedInteger('organization_id'); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // We'll grab the primary key name of the related models since it could be set to |
53 | 53 | // a non-standard name and not "id". We will then construct the constraint for |
54 | 54 | // our eagerly loading query so it returns the proper models from execution. |
55 | - (new CompositeKeyScope(array_map(function ($keyName) { |
|
55 | + (new CompositeKeyScope(array_map(function($keyName) { |
|
56 | 56 | return $this->related->getTable().'.'.$keyName; |
57 | 57 | }, $ownerKeys), $this->getEagerModelKeys($models), false, method_exists($this->related, 'getBinaryColumns') ? $this->related->getBinaryColumns() : []))->apply($this->query); |
58 | 58 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $dictionary = []; |
140 | 140 | |
141 | 141 | foreach ($results as $result) { |
142 | - $dictionary[implode($this->magicKeyDelimiter, array_map(function ($owner) use ($result) { |
|
142 | + $dictionary[implode($this->magicKeyDelimiter, array_map(function($owner) use ($result) { |
|
143 | 143 | return $result->getAttribute($owner); |
144 | 144 | }, $ownerKeys))] = $result; |
145 | 145 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | // and match back onto their children using these keys of the dictionary and |
149 | 149 | // the primary key of the children to map them onto the correct instances. |
150 | 150 | foreach ($models as $model) { |
151 | - $foreignKey = implode($this->magicKeyDelimiter, array_map(function ($foreign) use ($model) { |
|
151 | + $foreignKey = implode($this->magicKeyDelimiter, array_map(function($foreign) use ($model) { |
|
152 | 152 | return $model->{$foreign}; |
153 | 153 | }, $foreignKeys)); |
154 | 154 | if (isset($dictionary[$foreignKey])) { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | if (env('DEBUG_QUERY_LOG', true)) { |
39 | 39 | DB::listen( |
40 | - function (QueryExecuted $queryExecuted) { |
|
40 | + function(QueryExecuted $queryExecuted) { |
|
41 | 41 | var_dump($queryExecuted->sql); |
42 | 42 | var_dump($queryExecuted->bindings); |
43 | 43 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | protected function loadMigrationsFrom($paths): void |
59 | 59 | { |
60 | 60 | $paths = (is_array($paths)) ? $paths : [$paths]; |
61 | - $this->app->afterResolving('migrator', function ($migrator) use ($paths) { |
|
61 | + $this->app->afterResolving('migrator', function($migrator) use ($paths) { |
|
62 | 62 | foreach ((array) $paths as $path) { |
63 | 63 | $migrator->path($path); |
64 | 64 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function up() |
13 | 13 | { |
14 | - Schema::create('roles', function (Blueprint $table) { |
|
14 | + Schema::create('roles', function(Blueprint $table) { |
|
15 | 15 | $table->increments('role_id'); |
16 | 16 | $table->string('name'); |
17 | 17 | }); |