-
Notifications
You must be signed in to change notification settings - Fork 39
Installation
You'll need at least laravel v5.5
to get started.
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|4
- 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 single date & date range filters)
The package is available on packagist. If you need bootstrap 3 support, please run;
composer install leantony/laravel-grid ~1.0
For bootstrap 4
, please run
composer install leantony/laravel-grid "2.0.x-dev"
Bootstrap 4 support on this package is currently unstable though (still in development), so use with caution.
You can then publish the resources (views) and assets (css & js). CSS and JS are needed on your layout so that the grid is styled appropiately.
php artisan vendor:publish --provider="Leantony\Grid\Providers\ServiceProvider"
The css and js will be copied to public/vendor/leantony/grid
, while the resources will be copied to resources/vendor/leantony/grid
.
You can publish the assets and views separately by passing the
--tag
argument to the command. For the argument values, tryassets
,views
for js|css assets, views respectively.
You can also run php artisan vendor:publish
and select the provider index by the name Leantony\Grid\Providers\ServiceProvider
The views for the grid will be copied to resources/vendor/leantony/grid
.
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 runphp artisan vendor:publish
and select the provider index by the nameLeantony\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"
]