Cartalyst LLC.
Data-grid-export by Cartalyst
0
1
0
3
0

This package requires a valid subscription. Subscribe for access.

Preface

Introduction

Data Grid Export is a Data Grid Addon that adds support to export various formats to data grid.

We currently have the following export drivers:

  1. CSV Driver
  2. JSON Driver
  3. PDF Driver

The package requires PHP 8.0+ and follows the FIG standard PSR-4 to ensure a high level of interoperability between shared PHP code and is fully unit-tested.

Setup

Installation

Cartalyst packages utilize Composer, for more information on how to install Composer please read the Composer Documentation.

Preparation

Open your composer.json file and add the following to the require array:

"cartalyst/data-grid-export": "^5.0"

Add the following lines after the require array on your composer.json file:

"repositories": [
    { "type": "composer", "url": "https://packages.cartalyst.com" }
]

Note: Make sure that after the required changes your composer.json file is valid by running composer validate.

Install the dependencies

Run the composer install or composer update to install or update the new requirement.

Usage

To add export support to any data grid, just instantiate an export provider and pass it as the last argument to the data grid call.

$dataSource = ...

$columns = [
    'id',
    'name',
    'created_at',
];

$sorts = [
    'column' => 'created_at',
    'direction' => 'desc',
];

$settings = compact('columns');

$provider = new ExportProvider();

return datagrid($dataSource, $settings, $provider);

You wont find fancy lifestyle graphics and marketing bravado here. Just cold... hard... code...

Code Well, Rock On!
Processing Payment...