Download the PHP package machour/laravel-data-table without Composer

On this page you can find all versions of the php package machour/laravel-data-table. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-data-table

Laravel DataTable

A reusable, server-side DataTable system for Laravel + Inertia.js + React (TanStack Table v8). Define your table in a single PHP class — get sorting, filtering, pagination, exports, quick views, and a full-featured React UI out of the box.

Features

Requirements

PHP

Package Version
PHP ^8.2
Laravel ^11.0 | ^12.0
spatie/laravel-data ^4.0
spatie/laravel-query-builder ^6.0

Optional:

JavaScript

Your project must be set up with shadcn/ui (React + Tailwind CSS).

The shadcn add command will automatically install all required shadcn components (button, table, checkbox, etc.) and npm dependencies (@tanstack/react-table, @inertiajs/react, date-fns, lucide-react).

Installation

1. Install the Composer package

2. Install the React components via shadcn

This copies all DataTable components into your project (you own the code!) and installs the required shadcn UI dependencies automatically.

3. (Optional) Install Maatwebsite Excel for export support

Quick Start

1. Scaffold with the Artisan command

The fastest way to get started:

This generates:

Available options:

2. Or create your DataTable class manually

2. Add a route

3. Create your React page

That's it! You get sorting, filtering, pagination, column visibility, and column ordering out of the box.

Backend API

AbstractDataTable

Extend this class for each model. It extends Spatie\LaravelData\Data, so it's both a DTO and table configuration.

Method Required Description
tableColumns() Yes Returns Column[] defining the table structure
tableBaseQuery() Yes Returns the base Eloquent Builder
tableDefaultSort() No Default sort column (prefix with - for desc). Default: '-id'
tableQuickViews() No Returns QuickView[] for filter presets
tableAllowedFilters() No Auto-derived from filterable: true columns. Override for OperatorFilter or custom filters
tableAllowedSorts() No Auto-derived from sortable: true columns. Override for relation sorts
tableFooter(Collection) No Compute per-page footer aggregations
filterParamName() No URL query parameter name for filters. Default: 'filter'. Override to avoid collisions with multiple tables on one page
makeTable(?Request) Inherited Builds the DataTableResponse — call this in your route

Column

QuickView

OperatorFilter

Custom Spatie QueryBuilder filter supporting operator:value URL format:

Type Default Operator Available Operators
text contains contains, eq
number eq eq, neq, gt, gte, lt, lte, between
date eq eq, before, after, between
option in in, not_in
boolean eq eq

All types also support null and not_null.

Export (HasExport trait)

Register the export route:

Requires maatwebsite/excel to be installed.

Frontend API

<DataTable> Props

Options (Feature Flags)

All default to true. Pass options prop to disable:

Custom Cell Rendering

Row Actions

Bulk Actions

Footer Aggregations

Backend:

Frontend (custom rendering):

Column Group Styling

Multiple Tables on One Page

Override filterParamName() on each DataTable class so their URL parameters don't collide:

The frontend picks up the param name automatically from the server response. You can also set it explicitly via the filterParam prop:

URL Format

All state is URL-driven and bookmarkable:

localStorage Keys

The component persists user preferences under these keys:

Key Purpose
dt-columns-{tableName} Column visibility state
dt-column-order-{tableName} Column display order
dt-quickviews-{tableName} Custom saved quick views

Testing

License

MIT


All versions of laravel-data-table with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
spatie/laravel-data Version ^4.14
spatie/laravel-query-builder Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package machour/laravel-data-table contains the following files

Loading the files please wait ...