From ce9bcf4b91bb64e0a2517b869a61d1927d861076 Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 09:49:40 +0200 Subject: [PATCH 01/11] draft test for endpoint 'Get the metadata of all policies (of a single type)' --- tests/Routes/PoliciesControllerTest.php | 84 +++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/tests/Routes/PoliciesControllerTest.php b/tests/Routes/PoliciesControllerTest.php index daa0f355..c11891c1 100644 --- a/tests/Routes/PoliciesControllerTest.php +++ b/tests/Routes/PoliciesControllerTest.php @@ -16,6 +16,10 @@ class PoliciesControllerTest extends TestCase { private string $missingPoliciesRoute = 'v1/policies/missing'; + private string $allTermsOfUsePoliciesRoute = 'v1/policies/terms-of-use'; + + private string $allHostingPolicyPoliciesRoute = 'v1/policies/hosting-policy'; + private function createPolicy(string $type, CarbonImmutable $activeFrom, string $content): Policy { return Policy::create([ 'policy_type' => $type, @@ -176,4 +180,84 @@ public function testMissingPoliciesReturnsEmptyListWhenAllCurrentPoliciesAccepte ->assertStatus(200) ->assertJson(['items' => []]); } + + public function testGetAllTermsOfUsePolicies(): void { + $now = CarbonImmutable::now(); + + // Hosting Policies; should get excluded + $this->createPolicy('hosting-policy', $now->addDay(), 'hosting-policy/version-3.vue'); + $this->createPolicy('hosting-policy', $now->subWeek(), 'hosting-policy/version-2.vue'); + $this->createPolicy('hosting-policy', $now->subMonth(), 'hosting-policy/version-1.vue'); + + $termsOfUsePolicies = [ + $this->createPolicy('terms-of-use', $now->addDay(), 'terms-of-use/version-future.vue'), + $this->createPolicy('terms-of-use', $now->subWeek(), 'terms-of-use/version-2.vue'), + $this->createPolicy('terms-of-use', $now->subMonth(), 'terms-of-use/version-1.vue'), + ]; + + $response = $this->json('GET', $this->allTermsOfUsePoliciesRoute); + + $response->assertOk(); + $response->assertJsonStructure([ + 'items' => [ + '*' => [ + 'metadata' => [ + 'policy_id', + 'active_from', + 'content_vue_file', + 'type', + ], + ], + ], + ]); + + foreach($termsOfUsePolicies as $policy) { + $response->assertJsonFragment([ + 'policy_id' => $policy->id, + 'active_from' => $policy->active_from->format('Y-m-d'), + 'content_vue_file' => $policy->content_vue_file, + 'type' => 'terms-of-use', + ]); + } + } + + public function testGetAllHostingPolicies(): void { + $now = CarbonImmutable::now(); + + // Terms of Use; should get excluded + $this->createPolicy('terms-of-use', $now->addDay(), 'terms-of-use/version-3.vue'); + $this->createPolicy('terms-of-use', $now->subWeek(), 'terms-of-use/version-2.vue'); + $this->createPolicy('terms-of-use', $now->subMonth(), 'terms-of-use/version-1.vue'); + + $hostingPolicies = [ + $this->createPolicy('hosting-policy', $now->addDay(), 'hosting-policy/version-3.vue'), + $this->createPolicy('hosting-policy', $now->subWeek(), 'hosting-policy/version-2.vue'), + $this->createPolicy('hosting-policy', $now->subMonth(), 'hosting-policy/version-1.vue'), + ]; + + $response = $this->json('GET', $this->allHostingPolicyPoliciesRoute); + + $response->assertOk(); + $response->assertJsonStructure([ + 'items' => [ + '*' => [ + 'metadata' => [ + 'policy_id', + 'active_from', + 'content_vue_file', + 'type', + ], + ], + ], + ]); + + foreach($hostingPolicies as $policy) { + $response->assertJsonFragment([ + 'policy_id' => $policy->id, + 'active_from' => $policy->active_from->format('Y-m-d'), + 'content_vue_file' => $policy->content_vue_file, + 'type' => 'hosting-policy', + ]); + } + } } From a24a6ff289e205937a1ba3de26d2c796a543d419 Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 10:07:09 +0200 Subject: [PATCH 02/11] add tests for upcoming and current policy endpoints --- .../Http/Controllers/PolicyControllerTest.php | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/tests/Http/Controllers/PolicyControllerTest.php b/tests/Http/Controllers/PolicyControllerTest.php index 56829d65..dcaf420f 100644 --- a/tests/Http/Controllers/PolicyControllerTest.php +++ b/tests/Http/Controllers/PolicyControllerTest.php @@ -5,6 +5,7 @@ use App\Policy; use Illuminate\Foundation\Testing\DatabaseTransactions; use Tests\TestCase; +use Carbon\CarbonImmutable; class PolicyControllerTest extends TestCase { use DatabaseTransactions; @@ -46,4 +47,102 @@ public function testMissingPolicyByTypeAndActiveFromReturns404(): void { $request = $this->getJson('v1/policies/hosting-policy/by_active_from/2026-07-01'); $request->assertNotFound(); } + + public function testUpcomingTermsOfUseMissing(): void { + $request = $this->getJson('v1/policies/terms-of-use/upcoming'); + $request->assertNotFound(); + } + + public function testUpcomingHostingPolicyMissing(): void { + $request = $this->getJson('v1/policies/hosting-policy/upcoming'); + $request->assertNotFound(); + } + + public function testUpcomingTermsOfUseMultiple(): void { + $now = CarbonImmutable::now(); + + Policy::factory()->create([ + 'policy_type' => 'terms-of-use', + 'active_from' => $now->addWeek(), + ]); + + Policy::factory()->create([ + 'policy_type' => 'terms-of-use', + ]); + + $request = $this->getJson('v1/policies/terms-of-use/upcoming'); + $request->assertServerError(); + } + + public function testUpcomingTermsOfUse(): void { + $now = CarbonImmutable::now(); + + Policy::factory()->create([ + 'policy_type' => 'terms-of-use', + 'active_from' => $now->addWeek(), + 'content_vue_file' => 'terms-of-use/version-1.vue', + ]); + + $request = $this->getJson('v1/policies/terms-of-use/upcoming'); + + $request->assertOk(); + $request->assertJsonStructure([ + 'metadata' => [ + 'policy_id', + 'active_from', + 'content_vue_file', + 'type', + ], + ]); + + $request->assertJsonFragment([ + 'active_from' => $now->addWeek()->format('Y-m-d'), + 'type' => 'terms-of-use', + 'content_vue_file' => 'terms-of-use/version-1.vue', + ]); + } + + public function testCurrentTermsOfUseMissing(): void { + $request = $this->getJson('v1/policies/terms-of-use/current'); + $request->assertNotFound(); + } + + public function testCurrentHostingPolicyMissing(): void { + $request = $this->getJson('v1/policies/hosting-policy/current'); + $request->assertNotFound(); + } + + public function testCurrentTermsOfUse() { + $now = CarbonImmutable::now(); + + Policy::factory()->create([ + 'policy_type' => 'terms-of-use', + 'active_from' => $now->subMonth(), + 'content_vue_file' => 'terms-of-use/version-1.vue', + ]); + + $current = Policy::factory()->create([ + 'policy_type' => 'terms-of-use', + 'active_from' => $now->subWeek(), + 'content_vue_file' => 'terms-of-use/version-2.vue', + ]); + + $request = $this->getJson('v1/policies/terms-of-use/current'); + + $request->assertOk(); + $request->assertJsonStructure([ + 'metadata' => [ + 'policy_id', + 'active_from', + 'content_vue_file', + 'type', + ], + ]); + + $request->assertJsonFragment([ + 'active_from' => $current->active_from->format('Y-m-d'), + 'type' => $current->policy_type, + 'content_vue_file' => $current->content_vue_file + ]); + } } From dd7bd2b19de387556bb53a635cabe22c30a413d4 Mon Sep 17 00:00:00 2001 From: dena <91744937+deer-wmde@users.noreply.github.com> Date: Fri, 24 Jul 2026 10:11:12 +0200 Subject: [PATCH 03/11] tests: filetree cleanup (#1213) a small cleanup for consistency `Routes` seems to be favored https://github.com/wbstack/api/pull/1207#pullrequestreview-4755923965 --- tests/Routes/{ => Policies}/PoliciesControllerTest.php | 0 tests/Routes/{ => Policies}/PolicyAcceptanceControllerTest.php | 0 .../Controllers => Routes/Policies}/PolicyControllerTest.php | 0 tests/{Http/Controllers => Routes}/PublicWikiControllerTest.php | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename tests/Routes/{ => Policies}/PoliciesControllerTest.php (100%) rename tests/Routes/{ => Policies}/PolicyAcceptanceControllerTest.php (100%) rename tests/{Http/Controllers => Routes/Policies}/PolicyControllerTest.php (100%) rename tests/{Http/Controllers => Routes}/PublicWikiControllerTest.php (100%) diff --git a/tests/Routes/PoliciesControllerTest.php b/tests/Routes/Policies/PoliciesControllerTest.php similarity index 100% rename from tests/Routes/PoliciesControllerTest.php rename to tests/Routes/Policies/PoliciesControllerTest.php diff --git a/tests/Routes/PolicyAcceptanceControllerTest.php b/tests/Routes/Policies/PolicyAcceptanceControllerTest.php similarity index 100% rename from tests/Routes/PolicyAcceptanceControllerTest.php rename to tests/Routes/Policies/PolicyAcceptanceControllerTest.php diff --git a/tests/Http/Controllers/PolicyControllerTest.php b/tests/Routes/Policies/PolicyControllerTest.php similarity index 100% rename from tests/Http/Controllers/PolicyControllerTest.php rename to tests/Routes/Policies/PolicyControllerTest.php diff --git a/tests/Http/Controllers/PublicWikiControllerTest.php b/tests/Routes/PublicWikiControllerTest.php similarity index 100% rename from tests/Http/Controllers/PublicWikiControllerTest.php rename to tests/Routes/PublicWikiControllerTest.php From 39b49fe1d1eee576be6025921a4468f957283e2d Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 10:47:52 +0200 Subject: [PATCH 04/11] endpoint routes --- routes/api.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routes/api.php b/routes/api.php index c7b306f7..db2313d6 100644 --- a/routes/api.php +++ b/routes/api.php @@ -23,6 +23,9 @@ $router->post('complaint/sendMessage', ['uses' => 'ComplaintController@sendMessage']); $router->get('v1/policies/current', ['uses' => 'PoliciesController@getCurrentPolicies']); $router->get('v1/policies/{policy_type}/by_active_from/{active_from}', ['uses' => 'PolicyController@getPolicyByTypeAndActiveFrom']); + $router->get('v1/policies/{policy_type}/current', ['uses' => 'PolicyController@getCurrentPolicyByType']); + $router->get('v1/policies/{policy_type}/upcoming', ['uses' => 'PolicyController@getUpcomingPolicyByType']); + $router->get('v1/policies/{policy_type}', ['uses' => 'PoliciesController@getPoliciesByType']); $router->post('auth/login', ['uses' => 'Auth\LoginController@postLogin'])->name('login'); // Authed From 1e4ec90bfb0d338084bd67b20b65ca36a02dbb83 Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 10:48:10 +0200 Subject: [PATCH 05/11] upcoming + current endpoint --- app/Http/Controllers/PolicyController.php | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/app/Http/Controllers/PolicyController.php b/app/Http/Controllers/PolicyController.php index 8527fdaf..e890a2db 100644 --- a/app/Http/Controllers/PolicyController.php +++ b/app/Http/Controllers/PolicyController.php @@ -34,4 +34,56 @@ public function getPolicyByTypeAndActiveFrom($policyType, $activeFrom): PolicyRe return new PolicyResource($policy); } + + public function getCurrentPolicyByType($policyType): PolicyResource { + $validator = Validator::make( + [ + 'policy_type' => $policyType, + ], + [ + 'policy_type' => ['required', 'string', Rule::in(['terms-of-use', 'hosting-policy'])], + ] + ); + $validator->validate(); + $validated = $validator->safe(); + + $policy = Policy::where('policy_type', $validated['policy_type']) + ->where('active_from', '<=', today()) + ->latest('active_from') + ->orderByDesc('id') + ->first(); + + if (!$policy) { + abort(404, 'Policy not found.'); + } + + return new PolicyResource($policy); + } + + public function getUpcomingPolicyByType($policyType): PolicyResource { + $validator = Validator::make( + [ + 'policy_type' => $policyType, + ], + [ + 'policy_type' => ['required', 'string', Rule::in(['terms-of-use', 'hosting-policy'])], + ] + ); + $validator->validate(); + $validated = $validator->safe(); + + $policies = Policy::where('policy_type', $validated['policy_type']) + ->where(function ($query) { + $query->where('active_from', '>', today()) + ->orWhereNull('active_from'); + }) + ->orderBy('active_from') + ->get(); + + if ($policies->count() !== 1) { + abort(404, 'Policy not found.'); + } + + return new PolicyResource($policies->first()); + } } From 1bd391b440aaf4ff6cc17ed79167c0f2b080fde3 Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 10:51:09 +0200 Subject: [PATCH 06/11] add policies by type endpoinit --- app/Http/Controllers/PoliciesController.php | 32 +++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/PoliciesController.php b/app/Http/Controllers/PoliciesController.php index c1a0c449..e55e847c 100644 --- a/app/Http/Controllers/PoliciesController.php +++ b/app/Http/Controllers/PoliciesController.php @@ -7,8 +7,18 @@ use Carbon\CarbonImmutable; use Illuminate\Database\Query\Builder; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Validator; +use Illuminate\Validation\Rule; class PoliciesController extends Controller { + private function activePolicyIdsQuery(CarbonImmutable $now): Builder { + return Policy::query() + ->selectRaw('MAX(id) as id') + ->where('active_from', '<=', $now) + ->groupBy('policy_type') + ->toBase(); + } + public function getCurrentPolicies(): PoliciesCollection { $now = CarbonImmutable::now(); @@ -31,11 +41,21 @@ public function getMissingPolicies(Request $request): PoliciesCollection { return new PoliciesCollection($missingPolicies); } - private function activePolicyIdsQuery(CarbonImmutable $now): Builder { - return Policy::query() - ->selectRaw('MAX(id) as id') - ->where('active_from', '<=', $now) - ->groupBy('policy_type') - ->toBase(); + public function getPoliciesByType($policyType): PoliciesCollection { + $validator = Validator::make( + [ + 'policy_type' => $policyType, + ], + [ + 'policy_type' => ['required', 'string', Rule::in(['terms-of-use', 'hosting-policy'])], + ] + ); + + $validator->validate(); + $validated = $validator->safe(); + + $policies = Policy::where('policy_type', $validated['policy_type'])->get(); + + return new PoliciesCollection($policies); } } From 7b46c4c4f8bf5a9ae21b845a312b14bde09c67b5 Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 11:33:50 +0200 Subject: [PATCH 07/11] reorder api routes --- routes/api.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/routes/api.php b/routes/api.php index db2313d6..941c63d6 100644 --- a/routes/api.php +++ b/routes/api.php @@ -21,11 +21,6 @@ $router->post('user/resetPassword', ['uses' => 'Auth\ResetPasswordController@reset']); $router->post('contact/sendMessage', ['uses' => 'ContactController@sendMessage']); $router->post('complaint/sendMessage', ['uses' => 'ComplaintController@sendMessage']); - $router->get('v1/policies/current', ['uses' => 'PoliciesController@getCurrentPolicies']); - $router->get('v1/policies/{policy_type}/by_active_from/{active_from}', ['uses' => 'PolicyController@getPolicyByTypeAndActiveFrom']); - $router->get('v1/policies/{policy_type}/current', ['uses' => 'PolicyController@getCurrentPolicyByType']); - $router->get('v1/policies/{policy_type}/upcoming', ['uses' => 'PolicyController@getUpcomingPolicyByType']); - $router->get('v1/policies/{policy_type}', ['uses' => 'PoliciesController@getPoliciesByType']); $router->post('auth/login', ['uses' => 'Auth\LoginController@postLogin'])->name('login'); // Authed @@ -65,6 +60,13 @@ ->middleware(AuthorisedUsersForDeletedWikiMetricsMiddleware::class); }); + $router->get('v1/policies/current', ['uses' => 'PoliciesController@getCurrentPolicies']); + $router->get('v1/policies/{policy_type}/current', ['uses' => 'PolicyController@getCurrentPolicyByType']); + $router->get('v1/policies/{policy_type}/upcoming', ['uses' => 'PolicyController@getUpcomingPolicyByType']); + $router->get('v1/policies/{policy_type}/by_active_from/{active_from}', ['uses' => 'PolicyController@getPolicyByTypeAndActiveFrom']); + $router->get('v1/policies/{policy_type}', ['uses' => 'PoliciesController@getPoliciesByType']); + + $router->apiResource('wiki', 'PublicWikiController')->only(['index', 'show']); $router->apiResource('reusePrototype', 'PublicWikiController')->only(['index']); $router->apiResource('wikiConversionData', 'ConversionMetricController')->only(['index']); From fa7d1caf6c6125052ccd5ba77b5f1e73f98310bc Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 11:42:22 +0200 Subject: [PATCH 08/11] tests: fix missing --- tests/Routes/Policies/PolicyControllerTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Routes/Policies/PolicyControllerTest.php b/tests/Routes/Policies/PolicyControllerTest.php index dcaf420f..b08335a6 100644 --- a/tests/Routes/Policies/PolicyControllerTest.php +++ b/tests/Routes/Policies/PolicyControllerTest.php @@ -103,11 +103,15 @@ public function testUpcomingTermsOfUse(): void { } public function testCurrentTermsOfUseMissing(): void { + Policy::query()->delete(); + $request = $this->getJson('v1/policies/terms-of-use/current'); $request->assertNotFound(); } public function testCurrentHostingPolicyMissing(): void { + Policy::query()->delete(); + $request = $this->getJson('v1/policies/hosting-policy/current'); $request->assertNotFound(); } From b61d2b27264d53ae4194f5d06dee859d55fb3358 Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 11:58:06 +0200 Subject: [PATCH 09/11] fix upcoming route --- app/Http/Controllers/PolicyController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/PolicyController.php b/app/Http/Controllers/PolicyController.php index e890a2db..e1816740 100644 --- a/app/Http/Controllers/PolicyController.php +++ b/app/Http/Controllers/PolicyController.php @@ -80,10 +80,14 @@ public function getUpcomingPolicyByType($policyType): PolicyResource { ->orderBy('active_from') ->get(); - if ($policies->count() !== 1) { + if ($policies->count() < 1) { abort(404, 'Policy not found.'); } + if ($policies->count() > 1) { + abort(500, 'Multiple policies found.'); + } + return new PolicyResource($policies->first()); } } From 335db51686f154148fd0e0ea6384975176d0fc3b Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 11:58:13 +0200 Subject: [PATCH 10/11] fix tests --- tests/Routes/Policies/PolicyControllerTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Routes/Policies/PolicyControllerTest.php b/tests/Routes/Policies/PolicyControllerTest.php index b08335a6..1dd1cee5 100644 --- a/tests/Routes/Policies/PolicyControllerTest.php +++ b/tests/Routes/Policies/PolicyControllerTest.php @@ -49,16 +49,22 @@ public function testMissingPolicyByTypeAndActiveFromReturns404(): void { } public function testUpcomingTermsOfUseMissing(): void { + Policy::query()->delete(); + $request = $this->getJson('v1/policies/terms-of-use/upcoming'); $request->assertNotFound(); } public function testUpcomingHostingPolicyMissing(): void { + Policy::query()->delete(); + $request = $this->getJson('v1/policies/hosting-policy/upcoming'); $request->assertNotFound(); } public function testUpcomingTermsOfUseMultiple(): void { + Policy::query()->delete(); + $now = CarbonImmutable::now(); Policy::factory()->create([ @@ -68,6 +74,7 @@ public function testUpcomingTermsOfUseMultiple(): void { Policy::factory()->create([ 'policy_type' => 'terms-of-use', + 'active_from' => null, ]); $request = $this->getJson('v1/policies/terms-of-use/upcoming'); @@ -75,6 +82,8 @@ public function testUpcomingTermsOfUseMultiple(): void { } public function testUpcomingTermsOfUse(): void { + Policy::query()->delete(); + $now = CarbonImmutable::now(); Policy::factory()->create([ From 37141f83b07302fd390c38ffe344dd188421ea98 Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 24 Jul 2026 12:04:57 +0200 Subject: [PATCH 11/11] formatting --- routes/api.php | 1 - tests/Routes/Policies/PoliciesControllerTest.php | 4 ++-- tests/Routes/Policies/PolicyControllerTest.php | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/routes/api.php b/routes/api.php index 941c63d6..0c69b187 100644 --- a/routes/api.php +++ b/routes/api.php @@ -66,7 +66,6 @@ $router->get('v1/policies/{policy_type}/by_active_from/{active_from}', ['uses' => 'PolicyController@getPolicyByTypeAndActiveFrom']); $router->get('v1/policies/{policy_type}', ['uses' => 'PoliciesController@getPoliciesByType']); - $router->apiResource('wiki', 'PublicWikiController')->only(['index', 'show']); $router->apiResource('reusePrototype', 'PublicWikiController')->only(['index']); $router->apiResource('wikiConversionData', 'ConversionMetricController')->only(['index']); diff --git a/tests/Routes/Policies/PoliciesControllerTest.php b/tests/Routes/Policies/PoliciesControllerTest.php index c11891c1..b7ca5b90 100644 --- a/tests/Routes/Policies/PoliciesControllerTest.php +++ b/tests/Routes/Policies/PoliciesControllerTest.php @@ -211,7 +211,7 @@ public function testGetAllTermsOfUsePolicies(): void { ], ]); - foreach($termsOfUsePolicies as $policy) { + foreach ($termsOfUsePolicies as $policy) { $response->assertJsonFragment([ 'policy_id' => $policy->id, 'active_from' => $policy->active_from->format('Y-m-d'), @@ -251,7 +251,7 @@ public function testGetAllHostingPolicies(): void { ], ]); - foreach($hostingPolicies as $policy) { + foreach ($hostingPolicies as $policy) { $response->assertJsonFragment([ 'policy_id' => $policy->id, 'active_from' => $policy->active_from->format('Y-m-d'), diff --git a/tests/Routes/Policies/PolicyControllerTest.php b/tests/Routes/Policies/PolicyControllerTest.php index 1dd1cee5..a973c769 100644 --- a/tests/Routes/Policies/PolicyControllerTest.php +++ b/tests/Routes/Policies/PolicyControllerTest.php @@ -3,9 +3,9 @@ namespace Http\Controllers; use App\Policy; +use Carbon\CarbonImmutable; use Illuminate\Foundation\Testing\DatabaseTransactions; use Tests\TestCase; -use Carbon\CarbonImmutable; class PolicyControllerTest extends TestCase { use DatabaseTransactions; @@ -155,7 +155,7 @@ public function testCurrentTermsOfUse() { $request->assertJsonFragment([ 'active_from' => $current->active_from->format('Y-m-d'), 'type' => $current->policy_type, - 'content_vue_file' => $current->content_vue_file + 'content_vue_file' => $current->content_vue_file, ]); } }