<?php

namespace App\Http\Controllers;

use App\Domain\Participant\Models\Participant;
use Illuminate\Http\Request;

class ParticipantCardController extends Controller
{
    public function __invoke(Participant $participant)
    {
        $this->authorize('participants.view');

        $participant->load(['enrollments' => function ($q) {
            $q->where('status', 'active')->with('trainingGroup.program');
        }]);

        return view('print.participant-card', compact('participant'));
    }
}
