Skip to content

Commit 6b9cf2b

Browse files
committed
Added grid attributes to set table as: bordered, striped, hover, small
1 parent 7073617 commit 6b9cf2b

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This package is to displaying the model data in a Grid table.
2626

2727
Run the composer command:
2828

29-
`composer require itstructure/laravel-grid-view "~1.0.3"`
29+
`composer require itstructure/laravel-grid-view "~1.0.4"`
3030

3131
### If you are testing this package from a local server directory
3232

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
### CHANGE LOG:
22

3+
**1.0.4 July 10, 2020:**
4+
- Added grid attributes with default **true** value:
5+
- `tableBordered`
6+
- `tableStriped`
7+
- `tableHover`
8+
- `tableSmall`
9+
310
**1.0.3 July 10, 2020:**
411
- Container changes for `.card` bootstrap css style.
512

resources/views/grid.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</div>
3838
</div>
3939
<div class="card-body">
40-
<table class="table table-bordered table-striped table-hover">
40+
<table class="table @if($tableBordered) table-bordered @endif @if($tableStriped) table-striped @endif @if($tableHover) table-hover @endif @if($tableSmall) table-sm @endif">
4141
<thead>
4242
<tr>
4343
<th width="5%">#</th>

src/Grid.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,26 @@ class Grid
101101
*/
102102
protected $resetButtonLabel;
103103

104+
/**
105+
* @var bool
106+
*/
107+
protected $tableBordered = true;
108+
109+
/**
110+
* @var bool
111+
*/
112+
protected $tableStriped = true;
113+
114+
/**
115+
* @var bool
116+
*/
117+
protected $tableHover = true;
118+
119+
/**
120+
* @var bool
121+
*/
122+
protected $tableSmall = true;
123+
104124
/**
105125
* Grid constructor.
106126
* @param array $config
@@ -145,7 +165,11 @@ public function render(): string
145165
'useSendButtonAnyway' => $this->useSendButtonAnyway,
146166
'searchButtonLabel' => $this->getSearchButtonLabel(),
147167
'resetButtonLabel' => $this->getResetButtonLabel(),
148-
'sendButtonLabel' => $this->getSendButtonLabel()
168+
'sendButtonLabel' => $this->getSendButtonLabel(),
169+
'tableBordered' => $this->tableBordered,
170+
'tableStriped' => $this->tableStriped,
171+
'tableHover' => $this->tableHover,
172+
'tableSmall' => $this->tableSmall
149173
])->render();
150174
}
151175

0 commit comments

Comments
 (0)