Download the PHP package manusiakemos/laravel-tanstack without Composer
On this page you can find all versions of the php package manusiakemos/laravel-tanstack. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download manusiakemos/laravel-tanstack
More information about manusiakemos/laravel-tanstack
Files in manusiakemos/laravel-tanstack
Package laravel-tanstack
Short Description Modern server-side datatable for Laravel, designed for TanStack Table frontends. Drop-in query builder with searching, sorting, filtering, and pagination.
License MIT
Homepage https://github.com/manusiakemos/laravel-tanstack
Informations about the package laravel-tanstack
Laravel DataTables for TanStack
Modern server-side datatable for Laravel, purpose-built for TanStack Table frontends (React, Vue, Svelte, Solid). Inspired by yajra/laravel-datatables but with a clean REST API instead of the legacy datatables.net protocol.
Use this when you have an Inertia (or any SPA) frontend, want server-side processing, and want to stop writing pagination + search + sort + filter boilerplate for every table.
Why this package
- Three-line endpoints. Whitelist columns, return the response. That's it.
- REST-style query string. Clean, browser-DevTools-friendly, easy to cache.
- Type-safe FE companion. Pairs with
@manusiakemos/laravel-tanstack-react(separate package). - Eloquent or Query Builder. Both supported, no extra setup.
- No jQuery, no datatables.net baggage.
Installation
Publish the config (optional):
Quick start
Register it on a web route so it has access to the session (for Inertia auth):
Done. The controller returns a JsonResponse automatically because DataTable implements Responsable.
API protocol
Request
| Param | Description |
|---|---|
page |
1-indexed page number. Defaults to 1. |
per_page |
Rows per page. Clamped to max_per_page config. |
sort |
Comma-separated column:direction pairs. |
search |
Global search term across searchable() columns. |
filter[col]=v |
Equals filter. |
filter[col][]=v1&filter[col][]=v2 |
whereIn filter. |
Response
Features
Transform rows
Or use an API Resource:
Custom search
Custom sort column
For computed or relation columns:
Custom filter
Request: ?filter[created_between]=2024-01-01,2024-12-31
Authorization
Returns 403 if the closure returns false.
Default sort
Skip total count
For very large tables where count(*) over the unfiltered set is expensive:
The response will have meta.total = null; frontend should rely on filtered only.
Pagination limits
Query builder macro
For one-liner usage:
Inertia + TanStack pattern
The recommended setup: let Inertia render the page shell (layout, auth state, navigation), and let the table component fetch its own data from a separate JSON endpoint.
The table state lives in React; the page shell stays Inertia-managed. No full-page reload on pagination.
Security notes
- Never call
->searchable()or->sortable()with untrusted column names. The package enforces whitelisting — only listed columns can be searched/sorted — but you must define the list yourself. - Use
->authorize()for any non-public table. Or check authorization in the controller before returning the DataTable. - The package is read-only — it does not perform writes, so SQL injection surface is limited to filter values which are bound parameters.
Configuration
The full config/laravel-tanstack.php:
Testing
Requirements
- PHP 8.2+
- Laravel 11.x or 12.x
Roadmap
- [ ] PostgreSQL-specific
ILIKEsearch optimization - [ ] Laravel Scout integration for full-text search
- [ ] Vue 3 and Svelte FE companions
- [ ] Excel/CSV export endpoint
- [ ] Saved view / preset support
Contributing
Contributions are welcome — bug reports, feature requests, and pull requests.
Before opening a PR:
-
Fork the repo and create a feature branch from
main: -
Install dependencies:
- Make your change. Keep the public API stable unless the PR is explicitly a breaking change.
- Add or update tests under
tests/Featureortests/Unit. New features without tests will not be merged. -
Run the full quality gate locally — it must pass before you push:
- Update
CHANGELOG.mdunder the[Unreleased]section. Use the Keep a Changelog categories:Added,Changed,Deprecated,Removed,Fixed,Security. - Open the PR against
mainwith a clear description of the change, the motivation, and any breaking-change notes.
Branch naming: feat/..., fix/..., docs/..., refactor/..., test/....
Commit style: Conventional Commits preferred (feat:, fix:, docs:, chore:, refactor:, test:).
Issues: When filing a bug, include the Laravel version, PHP version, a minimal reproduction, and the actual vs expected behavior. For feature requests, describe the use case before the proposed API.
License
MIT.
All versions of laravel-tanstack with dependencies
illuminate/contracts Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0