Download the PHP package hesham-fouda/ag-grid-laravel without Composer

On this page you can find all versions of the php package hesham-fouda/ag-grid-laravel. 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 ag-grid-laravel

AG Grid server-side adapter for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package implements a server-side adapter for AG Grid with support for filtering, sorting, exporting and server-side selection.

Installation

You can install the package via composer:

You can publish the config file with:

This is the contents of the published config file:

Usage

Querying a resource

Simply accept an AgGridGetRowsRequest in your controller and return an instance of AgGridQueryBuilder for the model that you want to query. Filtering, sorting and exporting is handled automatically for you. You may also pass a JSON resource to the query builder to wrap your models with.

Set Filter Values

When using AG Grid with the serverSide row model, you are responsible for providing the values for the set value filter (the frontend only knows a subset of the whole data and therefore cannot know all possible set values).

See the AgGridSetValuesRequest class for the structure of the request.

IMPORTANT
You need to whitelist the columns the set filter values can be retrieved for. This can be done be providing an array with the columns/dotted relation:

If your model does not expose any relations or sensitive columns, you can also use ['*'] as wildcard.

Here's an example for the frontend implementation:

Server-side select

When using AG Grid with the serverSide row model, you can't just pass the selected IDs to the server when performing a batch operation. In this case, you may pass the current selection state of the grid to the server and resolve the selection there.

To do so, add the following to your request:

In your controller, use the AgGridQueryBuilder to resolve the selection:

Exports

To enable server-side exports for your models, you must implement the AgGridExportable interface. After that, you can just pass exportFormat as part of your request to the grid controller and the library handles transforming your models into Excel, CSV, or TSV files.

Custom Filters

Sometimes you may need to add custom filter scopes or other constraints to the query, which are not covered by the standard AG Grid filters. In this case, you may populate the customFilters object of the request with your own data. On the backend side, your model must implement the AgGridCustomFilterable interface as shown below:

Type definitions

You may use the following Typescript type definitions as a reference for implementing the requests on the frontend:

Frontend implementation

You are free to use any frontend technology or framework of your choice. However, here are some examples that you may use as a starting point four your own implementation

Creating a DataSource

In order to use the server-side row model, you must create a data source. Here is an exemplary implementation of such one:

Triggering a server-side export

Server-side exports are not implemented in AG Grid by default. However you can create a custom context menu or add a button somewhere that triggers the server-side export. The handler function may look something like this:

Tracking selection state

If you want to use server-side selects, you must track the current selection and filter state of the grid:

Limitations

TODOs

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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


All versions of ag-grid-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2
illuminate/contracts Version ^10.0|^11.0
maatwebsite/excel Version ^3.1
spatie/laravel-package-tools Version ^1.14.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 hesham-fouda/ag-grid-laravel contains the following files

Loading the files please wait ....