Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

665 B
Raw Blame
<?php

declare(strict_types=1);

namespace HiEvents\Resources\Lineup;

use HiEvents\DomainObjects\EventSpaceDomainObject;
use HiEvents\Resources\BaseResource;
use HiEvents\Resources\Location\LocationPublicResource;
use Illuminate\Http\Request;

/**
 * @mixin EventSpaceDomainObject
 */
class EventSpaceResourcePublic extends BaseResource
{
    public function toArray(Request $request): array
    {
        $location = $this->getEventLocation()?->getLocation();

        return [
            'id' => $this->getId(),
            'name' => $this->getName(),
            'venue' => $location === null ? null : new LocationPublicResource($location),
        ];
    }
}