Download the PHP package cav-s-a/inertiajs-tables-laravel-query-builder without Composer

On this page you can find all versions of the php package cav-s-a/inertiajs-tables-laravel-query-builder. 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 inertiajs-tables-laravel-query-builder

Inertia.js Tables for Laravel Query Builder

Latest Version on NPM npm Latest Version on Packagist run-tests

This package provides a DataTables-like experience for Inertia.js with support for searching, filtering, sorting, toggling columns, and pagination. It generates URLs that can be consumed by Spatie's excellent Laravel Query Builder package, with no additional logic needed. The components are styled with Tailwind CSS 2.0, but it's fully customizable and you can bring your own components. The data refresh logic is based on Inertia's Ping CRM demo.

Inertia.js Table for Laravel Query Builder

Launcher 🚀

Hey! We've built a Docker-based deployment tool to launch apps and sites fully containerized. You can find all features and the roadmap on our website, and we are on Twitter as well!

Support

We proudly support the community by developing Laravel packages and giving them away for free. Keeping track of issues and pull requests takes time, but we're happy to help! If this package saves you time or if you're relying on it professionally, please consider supporting the maintenance and development.

Features

Compatibility

Roadmap

Installation

You need to install both the server-side package as well as the client-side package. Note that this package is only compatible with Laravel 8, Vue 2.6 + 3.0 and requires the Tailwind Forms plugin.

Server-side installation (Laravel)

You can install the package via composer:

The package will automatically register the Service Provider which provides a table method that you can use on an Interia Response.

Search fields

With the addSearch method, you can specify which attributes are searchable. Search queries are passed to the URL query as a filter. This integrates seamlessly with the filtering feature of the Laravel Query Builder package.

You need to pass in the attribute and the label as arguments. With the addSearchRows method, you can add multiple attributes at once.

Filters

Filters are similar to search fields, but they use a select element instead of an input element. This way, you can present the user a pre-defined set of options. Under the hood, this uses the same filtering feature of the Laravel Query Builder package.

This method takes three arguments: the attribute, the label, and a key-value array with the options.

Columns

With the addColumn method, you can specify which columns you want to be toggleable. You need to pass in a key and label for each column. With the addColumns method, you can add multiple columns at once.

The addColumn method has an optional third parameter to disable the column by default:

Disable global search

By default, global search is enabled. This query will be applied to the filters by the global attribute. If you don't want to use the global search, you can use the disableGlobalSearch method.

Example controller

Client-side installation (Inertia)

You can install the package via either npm or yarn:

Add the repository path to the purge array of your Tailwind configuration file. This ensures that the styling also works on production builds.

Table component

To use the Table component and all its related features, you need to add the InteractsWithQueryBuilder mixin to your component and add the Tailwind2.Table component to the components key.

You can use the named #head slot to provide the table header and the named #body slot to provide the table body. You can use the showColumn method to determine if a column should be visible or not. You can use the sortBy method to set the column you want to sort by.

Page component example

Attributes and pagination

The filters, search, columns, and on-update attributes of the Table component are required, but the the InteractsWithQueryBuilder mixin magically provides the values for those attributes. You just have to specify them like the example template above.

When you pass a meta object to the table, it will automatically provide a pagination component.

You can override the default pagination translations with the setTranslations method of the base component. You can do this in your main JavaScript file:

Table.vue slots

The Table.vue has several slots that you can use to inject your own implementations.

Slot Description
tableFilter The location of the button + dropdown to select filters.
tableGlobalSearch The location of the input element that handles the global search.
tableAddSearchRow The location of the button + dropdown to add additional search rows.
tableColumns The location of the button + dropdown to toggle columns.
tableSearchRows The location of the input elements that handle the additional search rows.
tableWrapper The components that wraps the table element, handling overflow, shadow, padding, etc.
table The actual table element.
head The location of the table header.
body The location of the table body.
pagination The location of the paginator.

Each slot is provided with props to interact with the parent Table component.

Bring your own components

The templates and logic of the components are entirely separated. This way, you can create new templates while reusing the existing logic.

There are nine components that you can import and use as a mixin for your templates. For example, to write your own TableGlobalSearch component, you can import the base component and use its logic by adding it as a mixin.

Available components:

A good starting point would be to duplicate the js/Tailwind2 folder into your app and start customizing the templates from there.

Testing

You can run the PHP test suite with composer:

You can run the JS test suite with either npm or yarn:

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Other Laravel packages

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of inertiajs-tables-laravel-query-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0|^8.1
illuminate/support Version ^8.67|^v9.0.0-beta.4
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 cav-s-a/inertiajs-tables-laravel-query-builder contains the following files

Loading the files please wait ....