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/farmfun/reserveren.farmfun.be/app/Komma/Shop/Properties/Kms/PropertyController.php
<?php

namespace App\Komma\Shop\Properties\Kms;

use App\Komma\Kms\Core\SectionController;
use App\Komma\Shop\Properties\Models\Api\PropertyResource;
use App\Komma\Shop\Properties\Models\Property;
use Illuminate\Http\Request;

class PropertyController extends SectionController
{
    protected $slug = 'properties';

    protected $classModelName = Property::class;

    public function __construct()
    {
        $section = new PropertySection($this->slug);
        parent::__construct($section);
        $this->modelService = new PropertyService();
    }

    /**
     * For ajax requests
     *
     * @param Request $request
     * @param string $keyTranslationValue
     *
     * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
     * @see PropertyService::getPropertiesForPropertyKeyValue()
     */
    public function getPropertiesForPropertyKeyValue(Request $request, string $keyTranslationValue)
    {
        if (! $request->ajax()) {
            abort(403);
        }
        $propertiesCollection = $this->modelService->getPropertiesForPropertyKeyValue($keyTranslationValue)->get();

        return PropertyResource::collection($propertiesCollection);
    }
}