@@ -2,6 +2,6 @@ |
||
2 | 2 | |
3 | 3 | use Illuminate\Database\Eloquent\Builder; |
4 | 4 | |
5 | -Builder::macro('user', function ($value) { |
|
5 | +Builder::macro('user', function($value) { |
|
6 | 6 | return $this->where('user_id', $value); |
7 | 7 | }); |
@@ -2,18 +2,18 @@ |
||
2 | 2 | |
3 | 3 | use Illuminate\Database\Eloquent\Builder; |
4 | 4 | |
5 | -Builder::macro('label', function ($label, $key = 'label') { |
|
5 | +Builder::macro('label', function($label, $key = 'label') { |
|
6 | 6 | return $this->where($key, $label); |
7 | 7 | }); |
8 | 8 | |
9 | -Builder::macro('name', function ($name, $key = 'name') { |
|
9 | +Builder::macro('name', function($name, $key = 'name') { |
|
10 | 10 | return $this->where($key, $name); |
11 | 11 | }); |
12 | 12 | |
13 | -Builder::macro('code', function ($code, $key = 'code') { |
|
13 | +Builder::macro('code', function($code, $key = 'code') { |
|
14 | 14 | return $this->where($code, $code); |
15 | 15 | }); |
16 | 16 | |
17 | -Builder::macro('reference', function ($reference, $key = 'reference') { |
|
17 | +Builder::macro('reference', function($reference, $key = 'reference') { |
|
18 | 18 | return $this->where($key, $reference); |
19 | 19 | }); |
@@ -2,34 +2,34 @@ |
||
2 | 2 | |
3 | 3 | use Illuminate\Database\Eloquent\Builder; |
4 | 4 | |
5 | -Builder::macro('uuid', function ($uuid) { |
|
5 | +Builder::macro('uuid', function($uuid) { |
|
6 | 6 | return $this->where('uuid', $uuid); |
7 | 7 | }); |
8 | 8 | |
9 | -Builder::macro('findByUuid', function ($uuid) { |
|
9 | +Builder::macro('findByUuid', function($uuid) { |
|
10 | 10 | return $this->uuid($uuid)->firstOrFail(); |
11 | 11 | }); |
12 | 12 | |
13 | -Builder::macro('hashslug', function ($hashslug) { |
|
13 | +Builder::macro('hashslug', function($hashslug) { |
|
14 | 14 | return $this->where('hashslug', $hashslug); |
15 | 15 | }); |
16 | 16 | |
17 | -Builder::macro('findByHashSlug', function ($hashslug) { |
|
17 | +Builder::macro('findByHashSlug', function($hashslug) { |
|
18 | 18 | return $this->hashslug($hashslug)->firstOrFail(); |
19 | 19 | }); |
20 | 20 | |
21 | -Builder::macro('hashslugOrId', function ($identifier) { |
|
21 | +Builder::macro('hashslugOrId', function($identifier) { |
|
22 | 22 | return $this->hashslug($identifier)->orWhere('id', $identifier); |
23 | 23 | }); |
24 | 24 | |
25 | -Builder::macro('findByHashSlugOrId', function ($identifier) { |
|
25 | +Builder::macro('findByHashSlugOrId', function($identifier) { |
|
26 | 26 | return $this->hashslugOrId($identifier)->firstOrFail(); |
27 | 27 | }); |
28 | 28 | |
29 | -Builder::macro('slug', function ($slug) { |
|
29 | +Builder::macro('slug', function($slug) { |
|
30 | 30 | return $this->where('slug', $slug); |
31 | 31 | }); |
32 | 32 | |
33 | -Builder::macro('findBySlug', function ($slug) { |
|
33 | +Builder::macro('findBySlug', function($slug) { |
|
34 | 34 | return $this->slug($slug)->firstOrFail(); |
35 | 35 | }); |
@@ -5,11 +5,11 @@ |
||
5 | 5 | /* |
6 | 6 | * Common Setup |
7 | 7 | */ |
8 | -Blueprint::macro('user', function ($nullable = false) { |
|
8 | +Blueprint::macro('user', function($nullable = false) { |
|
9 | 9 | return $this->addForeign('users', ['nullable' => $nullable])->comment('Owner of the record.'); |
10 | 10 | }); |
11 | 11 | |
12 | -Blueprint::macro('standardTime', function () { |
|
12 | +Blueprint::macro('standardTime', function() { |
|
13 | 13 | $this->softDeletes(); |
14 | 14 | $this->timestamps(); |
15 | 15 | }); |
@@ -3,16 +3,16 @@ |
||
3 | 3 | use Illuminate\Database\Schema\Blueprint; |
4 | 4 | |
5 | 5 | // will be deprecated |
6 | -Blueprint::macro('actedStatus', function ($value = 'is_acted') { |
|
6 | +Blueprint::macro('actedStatus', function($value = 'is_acted') { |
|
7 | 7 | return $this->boolean($value)->default(false)->comment('Action statys in Boolean'); |
8 | 8 | }); |
9 | 9 | |
10 | 10 | // will be deprecated |
11 | -Blueprint::macro('actedAt', function ($value = 'acted_at') { |
|
11 | +Blueprint::macro('actedAt', function($value = 'acted_at') { |
|
12 | 12 | return $this->datetime($value)->nullable()->comment('Acted at Date & Time'); |
13 | 13 | }); |
14 | 14 | |
15 | 15 | // will be deprecated |
16 | -Blueprint::macro('actedBy', function ($value = 'acted_by') { |
|
16 | +Blueprint::macro('actedBy', function($value = 'acted_by') { |
|
17 | 17 | return $this->unsignedInteger($value)->nullable()->comment('Done / Acted by an actor'); |
18 | 18 | }); |
@@ -5,22 +5,22 @@ discard block |
||
5 | 5 | /* |
6 | 6 | * Short String |
7 | 7 | */ |
8 | -Blueprint::macro('label', function ($value = 'label', $length = 255) { |
|
8 | +Blueprint::macro('label', function($value = 'label', $length = 255) { |
|
9 | 9 | return $this->string($value, $length)->nullable()->comment($value); |
10 | 10 | }); |
11 | 11 | |
12 | -Blueprint::macro('name', function ($value = 'name', $length = 255) { |
|
12 | +Blueprint::macro('name', function($value = 'name', $length = 255) { |
|
13 | 13 | return $this->string($value, $length)->nullable()->comment($value); |
14 | 14 | }); |
15 | 15 | |
16 | -Blueprint::macro('code', function ($key = 'code', $length = 20) { |
|
16 | +Blueprint::macro('code', function($key = 'code', $length = 20) { |
|
17 | 17 | return $this->string($key, $length) |
18 | 18 | ->nullable() |
19 | 19 | ->index() |
20 | 20 | ->comment('Code'); |
21 | 21 | }); |
22 | 22 | |
23 | -Blueprint::macro('reference', function ($label = 'reference', $length = 64) { |
|
23 | +Blueprint::macro('reference', function($label = 'reference', $length = 64) { |
|
24 | 24 | return $this->string('reference', $length) |
25 | 25 | ->nullable() |
26 | 26 | ->unique() |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | /* |
32 | 32 | * Long String |
33 | 33 | */ |
34 | -Blueprint::macro('remarks', function ($value = 'remarks') { |
|
34 | +Blueprint::macro('remarks', function($value = 'remarks') { |
|
35 | 35 | return $this->text($value)->nullable()->comment('Remarks'); |
36 | 36 | }); |
37 | 37 | |
38 | -Blueprint::macro('description', function ($label = 'description') { |
|
38 | +Blueprint::macro('description', function($label = 'description') { |
|
39 | 39 | return $this->text($label)->nullable()->comment('Description'); |
40 | 40 | }); |
@@ -5,17 +5,17 @@ |
||
5 | 5 | /* |
6 | 6 | * Misc. |
7 | 7 | */ |
8 | -Blueprint::macro('ordering', function ($key = 'ordering', $length = 10) { |
|
8 | +Blueprint::macro('ordering', function($key = 'ordering', $length = 10) { |
|
9 | 9 | return $this->string($key, $length) |
10 | 10 | ->nullable() |
11 | 11 | ->comment('Ordering'); |
12 | 12 | }); |
13 | 13 | |
14 | -Blueprint::macro('percent', function ($key = 'percent') { |
|
14 | +Blueprint::macro('percent', function($key = 'percent') { |
|
15 | 15 | return $this->decimal($key, 5, 2)->default(0)->comment('Percentage'); |
16 | 16 | }); |
17 | 17 | |
18 | -Blueprint::macro('expired', function () { |
|
18 | +Blueprint::macro('expired', function() { |
|
19 | 19 | $this->boolean('is_expired')->default(false)->comment('Is Expired in Boolean'); |
20 | 20 | $this->datetime('expired_at')->nullable()->comment('Expired Date Time'); |
21 | 21 |
@@ -5,21 +5,21 @@ |
||
5 | 5 | /* |
6 | 6 | * Money |
7 | 7 | */ |
8 | -Blueprint::macro('money', function ($label = 'money', $percision = 8, $scale = 2) { |
|
8 | +Blueprint::macro('money', function($label = 'money', $percision = 8, $scale = 2) { |
|
9 | 9 | return $this->decimal($label, $percision, $scale) |
10 | 10 | ->nullable() |
11 | 11 | ->default(0.00) |
12 | 12 | ->comment('Money'); |
13 | 13 | }); |
14 | 14 | |
15 | -Blueprint::macro('amount', function ($label = 'amount') { |
|
15 | +Blueprint::macro('amount', function($label = 'amount') { |
|
16 | 16 | return $this->bigInteger($label) |
17 | 17 | ->nullable() |
18 | 18 | ->default(0) |
19 | 19 | ->comment('Big amount of money'); |
20 | 20 | }); |
21 | 21 | |
22 | -Blueprint::macro('smallAmount', function ($label = 'amount') { |
|
22 | +Blueprint::macro('smallAmount', function($label = 'amount') { |
|
23 | 23 | return $this->integer($label) |
24 | 24 | ->nullable() |
25 | 25 | ->default(0) |
@@ -5,11 +5,11 @@ discard block |
||
5 | 5 | /* |
6 | 6 | * Identifier Replacement |
7 | 7 | */ |
8 | -Blueprint::macro('uuid', function ($length = 64) { |
|
8 | +Blueprint::macro('uuid', function($length = 64) { |
|
9 | 9 | return $this->string('uuid', $length)->comment('UUID'); |
10 | 10 | }); |
11 | 11 | |
12 | -Blueprint::macro('hashslug', function ($length = 64) { |
|
12 | +Blueprint::macro('hashslug', function($length = 64) { |
|
13 | 13 | return $this->string('hashslug') |
14 | 14 | ->length($length) |
15 | 15 | ->nullable() |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | ->comment('Hashed Slug'); |
19 | 19 | }); |
20 | 20 | |
21 | -Blueprint::macro('slug', function () { |
|
21 | +Blueprint::macro('slug', function() { |
|
22 | 22 | return $this->string('slug') |
23 | 23 | ->nullable() |
24 | 24 | ->unique() |