Files
ladill-meet/app/Http/Controllers/Meet/Concerns/ResolvesEventsLinkContext.php
T
isaaccladandCursor 14e7ae9557
Deploy Ladill Meet / deploy (push) Successful in 49s
Replace native dialogs with app modals for Events link and unlink.
Link opens an in-page modal on conference and webinar show pages; unlink uses the shared confirm-dialog component.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 22:39:02 +00:00

25 lines
791 B
PHP

<?php
namespace App\Http\Controllers\Meet\Concerns;
use App\Models\Room;
use App\Services\Integrations\EventsLinkService;
use App\Services\Meet\MeetPermissions;
use App\Support\EventsSourceLink;
use Illuminate\Http\Request;
trait ResolvesEventsLinkContext
{
/** @return array{canManageEvents: bool, linkableEvents: list<array<string, mixed>>} */
protected function eventsLinkContext(Request $request, Room $room): array
{
$canManageEvents = app(MeetPermissions::class)->can($this->member($request), 'meetings.manage');
$linkableEvents = $canManageEvents && ! EventsSourceLink::isLinked($room)
? app(EventsLinkService::class)->linkableEvents($request->user())
: [];
return compact('canManageEvents', 'linkableEvents');
}
}