Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Tctable Laravel Package

voilab/tctable

Laravel package for building sortable, filterable, paginated tables from Eloquent data. Define columns and actions, render via views, and handle server-side searching and ordering. Useful for admin panels and data listings with minimal boilerplate.

View on GitHub
Deep Wiki
Context7

Create quickly and efficiently TCPDF tables with advanced page break options and memory optimization

Frequently asked questions about Tctable
How do I install `voilab/tctable` in a Laravel project?
Run `composer require voilab/tctable` and ensure TCPDF (`tecnickcom/tcpdf`) is installed. The package integrates seamlessly with Laravel’s service container, so no additional configuration is needed unless you’re using custom TCPDF settings.
Does this package support Laravel 10?
Yes, `voilab/tctable` is compatible with Laravel 10. However, verify TCPDF version compatibility (e.g., 6.5.x) in your `composer.json` to avoid conflicts. Test with your PHP version (8.1+) for edge cases.
Can I use this for server-side pagination and sorting?
No, this package focuses on **PDF table generation** with advanced page breaks, not web-based pagination. For web tables, pair it with Laravel Scout or a dedicated grid package like `yajra/laravel-datatables`.
How do I handle large datasets (e.g., 50,000+ rows) without memory issues?
Use TCPDF’s chunking via `setChunkSize()` in the package’s configuration. For extreme cases, pre-process data in batches or use Laravel Queues to generate PDFs asynchronously. Monitor memory with `memory_get_usage()`.
Is there a way to customize table headers/footers or merge cells?
Yes, extend the `TcTable` class or use TCPDF’s native methods like `Cell()` or `MultiCell()`. The package supports merged cells and custom headers/footers via TCPDF’s API—check the [TCPDF docs](https://tcpdf.org/) for advanced styling.
Can I integrate this with Laravel Queues for background PDF generation?
Absolutely. Dispatch a job (e.g., `GeneratePdfJob`) that uses `TcTable::render()` and stores the PDF in Laravel Storage. This is ideal for scaling to high-volume requests without blocking the web server.
What are the alternatives if I don’t want to use TCPDF?
For lightweight PDFs, consider `dompdf/dompdf` (simpler but less feature-rich). For advanced layouts, use TCPDF directly or explore `barryvdh/laravel-dompdf` (a DomPDF wrapper). However, `voilab/tctable` is TCPDF-centric and won’t work without it.
How do I test PDF generation in CI/CD pipelines?
Mock TCPDF’s file system operations (e.g., `Storage::fake()`) and assert PDF content using `PDF::setSourceFile()` or direct binary comparisons. Test edge cases like large datasets, Unicode text, and merged cells.
Does this package support real-time data (e.g., live calculations) in tables?
No, the package expects pre-fetched data (Eloquent collections or arrays). For real-time calculations, process data before passing it to `TcTable`—e.g., use Laravel Accessors or a service layer to compute aggregates.
How do I serve generated PDFs to users (e.g., download or preview)?
Use Laravel’s `Response::stream()` or `Storage::disk()->download()` to serve PDFs. For previews, embed the PDF in an `<iframe>` or use a library like `barryvdh/laravel-snappy` for HTML-to-PDF conversion if needed.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor