HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/rentman2019.komma.pro/app/Komma/PricingLabels/PricingLabelController.php
<?php

namespace App\Komma\PricingLabels;

use App\Http\Controllers\Controller;
use App\Komma\PricingLabels\Models\PricingLabel;

class PricingLabelController extends Controller
{
    /**
     * Create export of the translatable variable of all the pricing labels
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function oneSkyExport()
    {
        \App::changeLanguageByIso2('en');

        $pricingLabels = PricingLabel::with('translations', 'translation')
            ->get();

        $exportJson = [];

        foreach ($pricingLabels as $pricingLabel) {
            // Generate the page JSON
            $pricingJson = $this->oneSkyExporterService->generateModelJson($pricingLabel, ['name']);

            if (count($pricingJson) == 0) {
                continue;
            }

            // Generate the components JSON
            $exportJson[$pricingLabel->code_name] = $pricingJson;
        }

        return response()->json($exportJson);
    }
}