Example of Invokable controllers in bytefury/crater

File routes/web.php (link to Github)
use Illuminate\Support\Facades\Route;
use Crater\Http\Controllers\V1\Invoice\InvoicePdfController;

//
Route::get('/invoices/pdf/{invoice:unique_hash}', InvoicePdfController::class);
//
File app/Http/Controllers/V1/Invoice/InvoicePdfController.php (link to Github)
use Crater\Http\Controllers\Controller;
use Crater\Models\Invoice;

class InvoicePdfController extends Controller
{
    public function __invoke(Invoice $invoice)
    {
        return $invoice->getGeneratedPDFOrStream('invoice');
    }
}

Additional resources on Invokable controllers: