# 5. RM Details View — `resources/views/rm/details.blade.php`

## Current State (line 14-16)

```html
<div class="col-sm-6">
    <button type="button" class="btn btn-sm btn-primary float-right" ><i class="nav-icon fa fa-calendar"></i> Create Event</button>
</div>
```

The button is a dead `<button>` with no action.

## Change

Replace line 15 with a conditional link. Show the button only if no event is linked to this RM request:

```html
<div class="col-sm-6">
    @if(empty($eventDetails))
        <a href="{{ url('rm/create-event/' . $rmDetails->uuid) }}" class="btn btn-sm btn-primary float-right">
            <i class="nav-icon fa fa-calendar"></i> Create Event
        </a>
    @endif
</div>
```

**What this does:**
- If `$eventDetails` is null (no event linked to RM request) → show the "Create Event" link
- If event already exists → hide the button entirely (event details are already displayed in the card below)
- The `<a>` tag navigates to `GET /rm/create-event/{rmUuid}` which loads the create event form

**Why `$eventDetails`?** This variable is already passed to the view by `RmController::rmRequestsDetails()` (line 33-36 of controller). It's `null` when `record_type` is not 'event' or when no event is linked.

---

## No other changes to this file.

The rest of the view (event details card, chat section, modal) remains untouched. Once the event is created and the user is redirected back to this page, `$eventDetails` will be populated and the event info will display in the existing card (lines 44-62).
