Skip to content

Installation

leantony edited this page Apr 7, 2018 · 8 revisions

Requirements

The grid supports pjax out of the box. For pjax support on laravel, try - spatie/laravel-pjax, or create the middleware on your own using jeffrey way's middleware.

  • Bootstrap 3 (for the styling)
  • Font awesome (for icons)
  • Jquery (required by bootstrap and the package's javascript)
  • Jquery pjax (quickly view data without having to reload the page)
  • Block UI (optional - to 'block' the UI when doing an AJAX request that might presumably take a while).
  • Date picker (optional - for the date filters)

Installation instructions

The package is available on packagist. Just run;

composer install leantony/laravel-grid

You can then publish the resources (views) and assets (css & js), incase you need to customize them. The css and js will be copied to public/vendor/leantony/grid

php artisan vendor:publish --provider="Leantony\Grid\Providers\ServiceProvider"

You can publish the assets and views separately by passing the --tag argument to the command. For the argument values, try assets, views or config for js|css assets, views and config respectively. You may also run php artisan vendor:publish and select the provider index by the name Leantony\Grid\Providers\ServiceProvider.

When the package is updated, it is highly likely that you will also need to update the javascript assets. To do that, run this command below after an update;

php artisan vendor:publish --provider="Leantony\Grid\Providers\ServiceProvider" --tag=assets --force

You can also place this command in composer so that it is executed automatically on each update run. Like this;

// ... composer config
"post-autoload-dump": [
    "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
    "@php artisan package:discover",
    "@php artisan vendor:publish --provider=\"Leantony\\Grid\\Providers\\ServiceProvider\" --tag=assets --force"
]

Clone this wiki locally