Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aginev committed Sep 17, 2020
1 parent b0b7e93 commit c8b5ffa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 31 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aginev/datagrid",
"description": "Datagrid package for Laravel v5",
"description": "Datagrid Package for Laravel v5+",
"keywords": [
"Datagrid",
"Datagrid Package for Laravel v5+"
Expand Down
45 changes: 15 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Datagrid For Laravel 5
# Datagrid For Laravel 5+
Package that easily converts collection of models to a datagrid table. The main goal of the package is to build for you a table with sorting and filters per column. You are defining the grid structure in your controller, pass the datagrid to the view and show it there. This will give you a really clean views, just a single line to show the table + filters + sorting + pagination. Keep in mind that filtering and sorting the data is up to you!

## Features
Expand All @@ -12,24 +12,14 @@ Package that easily converts collection of models to a datagrid table. The main
- Columns has data attributes based on a column data key

## Requires
Build only for Laravel Framework 5 only!

```json
"require": {
"php": "^7.2",
"illuminate/support": "^6.0",
"illuminate/contracts": "^6.0",
"illuminate/view": "^6.0",
"laravelcollective/html": "^6.0"
}
```
Build to be used with Laravel only!

## Installation
Require package at your composer.json file like so
```json
{
"require": {
"aginev/datagrid": "1.0.*"
"aginev/datagrid": "2.0.*"
}
}
```
Expand All @@ -44,20 +34,10 @@ Or in terminal
composer require aginev/datagrid:1.0.*
```

Add Service Provider to your config/app.php like so
```php
Aginev\Datagrid\DatagridServiceProvider::class,
```

Optionaly you could add package alias, if not it will be loaded automatically
```php
'Datagrid' => Aginev\Datagrid\Datagrid::class,
```

## HOWTO
Let's consider that we have users and user roles (roles) table at our system.

### Users table consists of:
### Users table

**id:** primary key

Expand All @@ -75,7 +55,7 @@ Let's consider that we have users and user roles (roles) table at our system.

**updated_at:** when is the latest update

### Roles table consists of:
### Roles Table

**id:** primary key

Expand Down Expand Up @@ -163,17 +143,22 @@ Lets show the grid in the view. grid-table param is not required and it's the id
...
```

### Modifying default view
### Modifying Default View

```sh
php artisan vendor:publish --provider="Aginev\Datagrid\DatagridServiceProvider" --tag="views"
```

The most stupid thing is to go at vendor/aginev/datagrid/src/Views and to edit grid.blade.php. Doing so after a package update all your changes will be overwrited!
This will copy the view to `resources/views/vendor/datagrid/datagrid.blade.php`. Editing this file you will be able to modify the grid view as you like with no chance to loose your changes.

Much better way is to publish the view to your project like so:
### Modifying Config

```sh
php artisan vendor:publish --provider="Aginev\Datagrid\DatagridServiceProvider" --tag="views"
php artisan vendor:publish --provider="Aginev\Datagrid\DatagridServiceProvider" --tag="config"
```

This will copy the view to resources/views/vendor/datagrid/datagrid.blade.php. Editing this file you will be able to modify the grid view as you like with no chance to loose your changes.
This will copy the config to `config/datagrid.php`.


## License
MIT - http://opensource.org/licenses/MIT

0 comments on commit c8b5ffa

Please sign in to comment.