# fluent-booking/trunk/app/Http/Controllers/EventController.php

Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution, version trunk. 43 lines.

- Page: https://pluginprobe.com/plugins/fluent-booking/trunk/code/app/Http/Controllers/EventController.php
- Raw: https://pluginprobe.com/plugins/fluent-booking/trunk/raw/app/Http/Controllers/EventController.php
- Modified: 2026-05-12T13:33:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-booking/trunk/code/app/Http/Controllers/EventController.php#L10-L20`.

```php
<?php

namespace FluentBooking\App\Http\Controllers;

use FluentBooking\App\Models\CalendarSlot;
use FluentBooking\Framework\Http\Request\Request;
use FluentBooking\Framework\Support\Arr;

class EventController extends Controller
{
    public function getEvent(Request $request, $eventId)
    {
        $calendarEvent = CalendarSlot::with('calendar')->find($eventId);

        $eventHash = Arr::get($request->all(), 'event_hash');

        if (!$calendarEvent && $eventHash) {
            $calendarEvent = CalendarSlot::with('calendar')->where('hash', $eventHash)->first();
        }

        if (!$calendarEvent) {
            return $this->sendError([
                'message' => __('Calendar Event not found', 'fluent-booking')
            ]);
        }

        if (!$calendarEvent->calendar) {
            return $this->sendError([
                'message' => __('Calendar not found', 'fluent-booking')
            ]);
        }

        $calendarEvent->author_profile = $calendarEvent->getAuthorProfile();

        $calendarEvent->calendar->author_profile = $calendarEvent->calendar->getAuthorProfile();

        return [
            'calendar_event' => $calendarEvent
        ];
    }

}

```
