Download the PHP package redot/livewire-datatable without Composer

On this page you can find all versions of the php package redot/livewire-datatable. 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 livewire-datatable

Livewire Datatable

Livewire Datatable is a package that allows you to create a table with sorting, searching, and pagination without having to write a lot of code. It is built on top of Livewire and uses Tabler for the UI.

Note: This package doesn't include any CSS or JS files. You need to install Tabler yourself, or publish the views and modify them to use your own CSS and JS files.

Installation

You can install the package via composer:

Now you can run the following command to scaffold a new Datatable:

Configuration

If you wish, you can publish the views and modify them to use your own CSS and JS files:

You can also publish the language files:

Usage

Let's say you have a User model and you want to display a table of users. First, you need to create a Livewire component that extends the Redot\LivewireDatatable\Datatable class:

Next, you need to define the columns that you want to display in the table. You can do this by overriding the columns method:

The Column class has a make method that accepts two arguments: the column name and the column key. The column key is the name of the column in the database.

Each column has a sortable, searchable, and format method. The sortable method adds a sort button to the column header. The searchable method adds the column to the search query. The format method accepts a closure that receives the value of the column and should return the formatted value.

You can also define a column without a column key. In this case, you need to define a resolve method that accepts a closure. The closure receives the current row as an argument and should return the value of the column.

Next, you need to define the query that will be used to fetch the data. You can do this by overriding the query method:

(Optional) You can also define the actions that will be displayed in the table. You can do this by overriding the actions method:

The Action class has a view, edit, and delete method that accepts the route name as an argument. The route name should contain the model key as a route parameter.

Finally, you need to render the table in your view:

Dependencies

This package depends on the following packages:

Conclusion

That's it! You now have a table with sorting, searching, and pagination. You can check out the code to see how it works, until we have proper documentation. If you have any questions or suggestions, feel free to open an issue on GitHub.


All versions of livewire-datatable with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/console Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0
livewire/livewire Version ^3.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 redot/livewire-datatable contains the following files

Loading the files please wait ....