Deploy Ladill Meet / deploy (push) Successful in 49s
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>
25 lines
791 B
PHP
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');
|
|
}
|
|
}
|