@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('ministries', function (Blueprint $table) { |
|
16 | + Schema::create('ministries', function(Blueprint $table) { |
|
17 | 17 | $table->string('id', 150)->primary(); |
18 | 18 | $table->string('name'); |
19 | 19 | $table->string('email', 150)->unique(); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('oauth_access_tokens', function (Blueprint $table) { |
|
16 | + Schema::create('oauth_access_tokens', function(Blueprint $table) { |
|
17 | 17 | $table->string('id', 100)->primary(); |
18 | 18 | $table->string('user_id', 150)->index()->nullable(); |
19 | 19 | $table->unsignedInteger('client_id'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('images', function (Blueprint $table) { |
|
16 | + Schema::create('images', function(Blueprint $table) { |
|
17 | 17 | $table->string('id', 150); |
18 | 18 | $table->string('imageable_id', 150)->index(); |
19 | 19 | $table->string('imageable_type'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('oauth_auth_codes', function (Blueprint $table) { |
|
16 | + Schema::create('oauth_auth_codes', function(Blueprint $table) { |
|
17 | 17 | $table->string('id', 100)->primary(); |
18 | 18 | $table->string('user_id', 150); |
19 | 19 | $table->unsignedInteger('client_id'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('oauth_personal_access_clients', function (Blueprint $table) { |
|
16 | + Schema::create('oauth_personal_access_clients', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->unsignedInteger('client_id')->index(); |
19 | 19 | $table->timestamps(); |
@@ -13,10 +13,10 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('accounts', function (Blueprint $table) { |
|
16 | + Schema::create('accounts', function(Blueprint $table) { |
|
17 | 17 | $table->string('id', 150)->primary(); |
18 | 18 | $table->string('ministry_id', 150)->index(); |
19 | - $table->enum('level', ['Free', 'Premium', 'PremiumPlus'])->default('Free'); |
|
19 | + $table->enum('level', [ 'Free', 'Premium', 'PremiumPlus' ])->default('Free'); |
|
20 | 20 | $table->dateTime('expiry_date')->default(now()); |
21 | 21 | $table->timestamps(); |
22 | 22 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('comments', function (Blueprint $table) { |
|
16 | + Schema::create('comments', function(Blueprint $table) { |
|
17 | 17 | $table->string('id', 150); |
18 | 18 | $table->string('creatable_id', 150)->index(); |
19 | 19 | $table->string('creatable_type'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | __DIR__ . '/../config/faithgen-sdk.php' => config_path('faithgen-sdk.php'), |
30 | 30 | ], 'faithgen-sdk-config'); |
31 | 31 | |
32 | - $this->setUpSourceFiles(function (){ |
|
32 | + $this->setUpSourceFiles(function() { |
|
33 | 33 | $this->publishes([ |
34 | 34 | __DIR__ . '/../database/migrations/' => database_path('migrations'), |
35 | 35 | ], 'faithgen-sdk-migrations'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | private function registerApiRoutes() |
72 | 72 | { |
73 | - Route::group($this->apiRouteConfiguration(), function () { |
|
73 | + Route::group($this->apiRouteConfiguration(), function() { |
|
74 | 74 | $this->loadRoutesFrom(__DIR__ . '/../routes/api.php'); |
75 | 75 | }); |
76 | 76 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | private function registerParentRoutes() |
92 | 92 | { |
93 | 93 | if (config('faithgen-sdk.source')) { |
94 | - Route::group($this->parentRouteConfiguration(), function () { |
|
94 | + Route::group($this->parentRouteConfiguration(), function() { |
|
95 | 95 | $this->loadRoutesFrom(__DIR__ . '/../routes/source.php'); |
96 | 96 | }); |
97 | 97 | |
@@ -105,20 +105,20 @@ discard block |
||
105 | 105 | { |
106 | 106 | return [ |
107 | 107 | 'prefix' => config('faithgen-sdk.prefix'), |
108 | - 'middleware' => ['bindings'] |
|
108 | + 'middleware' => [ 'bindings' ] |
|
109 | 109 | ]; |
110 | 110 | } |
111 | 111 | |
112 | 112 | private function registerAuthRoutes() |
113 | 113 | { |
114 | - Route::group($this->authRouteConfiguration(), function () { |
|
114 | + Route::group($this->authRouteConfiguration(), function() { |
|
115 | 115 | $this->loadRoutesFrom(__DIR__ . '/../routes/auth.php'); |
116 | 116 | }); |
117 | 117 | } |
118 | 118 | |
119 | 119 | private function registerUserAuthRoutes() |
120 | 120 | { |
121 | - Route::group($this->authRouteConfiguration(), function () { |
|
121 | + Route::group($this->authRouteConfiguration(), function() { |
|
122 | 122 | $this->loadRoutesFrom(__DIR__ . '/../routes/users-auth.php'); |
123 | 123 | }); |
124 | 124 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function search() |
16 | 16 | { |
17 | - return function ($attributes, ?string $filter_text) { |
|
17 | + return function($attributes, ?string $filter_text) { |
|
18 | 18 | |
19 | 19 | if ($filter_text) |
20 | 20 | $filter_text = '%' . $filter_text . '%'; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | if (!Str::of($key)->contains('.')) |
37 | 37 | $query->orWhere($key, 'LIKE', $filter_text); |
38 | 38 | else { |
39 | - [$relationship, $column] = explode('.', $key); |
|
39 | + [ $relationship, $column ] = explode('.', $key); |
|
40 | 40 | |
41 | 41 | // $eloquentBuilder->orWhereHas($relationship, fn($model) => $model->where($column, 'LIKE', $filter_text)); |
42 | 42 | } |
@@ -16,11 +16,13 @@ discard block |
||
16 | 16 | { |
17 | 17 | return function ($attributes, ?string $filter_text) { |
18 | 18 | |
19 | - if ($filter_text) |
|
20 | - $filter_text = '%' . $filter_text . '%'; |
|
19 | + if ($filter_text) { |
|
20 | + $filter_text = '%' . $filter_text . '%'; |
|
21 | + } |
|
21 | 22 | |
22 | - if (is_string($attributes)) |
|
23 | - return $this->where($attributes, 'LIKE', $filter_text); |
|
23 | + if (is_string($attributes)) { |
|
24 | + return $this->where($attributes, 'LIKE', $filter_text); |
|
25 | + } |
|
24 | 26 | |
25 | 27 | if (is_array($attributes)) { |
26 | 28 | $attributes = collect($attributes); |
@@ -31,11 +33,11 @@ discard block |
||
31 | 33 | |
32 | 34 | $query = $this->where($attribute, 'LIKE', $filter_text); |
33 | 35 | |
34 | - if (sizeof($remainderKeys)) |
|
35 | - foreach ($remainderKeys as $key) { |
|
36 | + if (sizeof($remainderKeys)) { |
|
37 | + foreach ($remainderKeys as $key) { |
|
36 | 38 | if (!Str::of($key)->contains('.')) |
37 | 39 | $query->orWhere($key, 'LIKE', $filter_text); |
38 | - else { |
|
40 | + } else { |
|
39 | 41 | [$relationship, $column] = explode('.', $key); |
40 | 42 | |
41 | 43 | // $eloquentBuilder->orWhereHas($relationship, fn($model) => $model->where($column, 'LIKE', $filter_text)); |
@@ -44,7 +46,9 @@ discard block |
||
44 | 46 | |
45 | 47 | return $query; |
46 | 48 | |
47 | - } else abort(402, 'Invalid search fields'); |
|
49 | + } else { |
|
50 | + abort(402, 'Invalid search fields'); |
|
51 | + } |
|
48 | 52 | }; |
49 | 53 | } |
50 | 54 | } |