Download the PHP package hthang369/laravel-grid without Composer

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

Laravel grid

Live demo: here

Build Status Latest Stable Version Latest Unstable Version Total Downloads

This package allows rendering of data via a tabular format (grid). The grid uses bootstrap classes to style the table elements. Icons used are from font-awesome, and most of the functionality is insipred by the yii2's framework's gridview widget.

Requirements

Note that from version 2.0.2 onwards, you'll need the package barryvdh/laravel-dompdf to export data from the grid as PDF

Getting started

Install

The package is available on packagist. Just run;

For bootstrap 3 support, consider installing version 1.0. Version 1.0 though is pretty not much updated at this point, so may lack some features.

If you can't wait for a release inorder to try any fixes, or the latest features, just run;

Publish assets

The grid comes with a config file, CSS assets, JS assets and view files. The command below should allow you to publish them.

You can also choose to publish the assets and views separately by passing the --tag argument to the command. For the argument values, try assets, views, config for js|css assets, views and config respectively.

Add/Customize your layout

Be sure to also include the necessary javascript and css assets on your layout. An example layout is as shown below;

Creating grids

A laravel command is available to make it easy to create grids. It's usage is as shown below;

Just make sure you replace {modelClass} with your actual eloquent model class. E.g

Once this is run, a grid will be generated. Default namespace for grid generation is App\Grids. Once the generation of the grid is done, you can add add it in your controller like this;

Just make sure that you do not call ->get() on the query.

If you inject the interface on the controller, just make sure that you add a binding to the service provider. Like this;

Otherwise, you can also instantiate the grid class like any other class then inject any constructor dependencies you might need.

If you need to pass extra data to the view specified, you just need to pass the data as arguments, just as you do normally on any other laravel controller;

For eloquent relationships, its basically the same approach. Like this;

And once again, just make sure that you do not call ->get() on the query.

Rendering the grid

To display your grid, simply add this to your view. Or any appropriate variable you passed into the renderOn method.

For a quick demonstration, be sure to check out the demo here. The demo's source code is also available on github.

Updating local JS and CSS assets after package updates

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;

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

Next up

Rendering the grid


All versions of laravel-grid with dependencies

PHP Build Version
Package Version
Requires illuminate/view Version ^5.5|^6|^7|^8
illuminate/support Version ^5.5|^6|^7|^8
illuminate/console Version ^5.5|^6|^7|^8
illuminate/contracts Version ^5.5|^6|^7|^8
illuminate/http Version ^5.5|^6|^7|^8
illuminate/database Version ^5.5|^6|^7|^8
illuminate/pagination Version ^5.5|^6|^7|^8
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 hthang369/laravel-grid contains the following files

Loading the files please wait ....