<?php

namespace App\Http\Controllers;

use App\Domain\Training\Models\TrainingGroup;
use Illuminate\Http\Request;

class GroupSchedulePrintController extends Controller
{
    public function __invoke(TrainingGroup $group)
    {
        $this->authorize('groups.list');

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

        return view('print.group-schedule', compact('group'));
    }
}
