<?php

namespace App\Http\Controllers;

use App\Domain\Financial\Models\Invoice;
use Illuminate\Support\Facades\Gate;

class InvoicePrintController extends Controller
{
    public function __invoke(Invoice $invoice)
    {
        Gate::authorize('invoices.view');

        $invoice->load(['items', 'payments', 'billable']);

        return view('print.invoice', compact('invoice'));
    }
}
