Skip to content

Commit dc03cb2

Browse files
committed
- Cleanup
1 parent 10ae01b commit dc03cb2

File tree

10 files changed

+422
-341
lines changed

10 files changed

+422
-341
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
# A Table Component for Laravel Livewire
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/rappasoft/livewire-tables.svg?style=flat-square)](https://packagist.org/packages/rappasoft/livewire-tables)
4-
![Run Tests](https://github.com/rappasoft/livewire-tables/workflows/Run%20Tests/badge.svg?branch=master)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/rappasoft/laravel-livewire-tables.svg?style=flat-square)](https://packagist.org/packages/rappasoft/laravel-livewire-tables)
4+
![Run Tests](https://github.com/rappasoft/laravel-livewire-tables/workflows/Run%20Tests/badge.svg?branch=master)
55
[![StyleCI](https://styleci.io/repos/242222088/shield?style=plastic)](https://github.styleci.io/repos/242222088)
6-
[![Code Coverage](https://scrutinizer-ci.com/g/rappasoft/livewire-tables/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/rappasoft/livewire-tables/?branch=master)
7-
[![Quality Score](https://img.shields.io/scrutinizer/g/rappasoft/livewire-tables.svg?style=flat-square)](https://scrutinizer-ci.com/g/rappasoft/livewire-tables)
8-
[![Total Downloads](https://img.shields.io/packagist/dt/rappasoft/livewire-tables.svg?style=flat-square)](https://packagist.org/packages/rappasoft/livewire-tables)
6+
[![Code Coverage](https://scrutinizer-ci.com/g/rappasoft/laravel-livewire-tables/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/rappasoft/laravel-livewire-tables/?branch=master)
7+
[![Quality Score](https://img.shields.io/scrutinizer/g/rappasoft/laravel-livewire-tables.svg?style=flat-square)](https://scrutinizer-ci.com/g/rappasoft/laravel-livewire-tables)
8+
[![Total Downloads](https://img.shields.io/packagist/dt/rappasoft/laravel-livewire-tables.svg?style=flat-square)](https://packagist.org/packages/rappasoft/laravel-livewire-tables)
99

1010
A Laravel Livewire extension for data tables.
1111

12+
Inspiration from:
13+
14+
[https://github.com/kdion4891/laravel-livewire-tables](https://github.com/kdion4891/laravel-livewire-tables)
15+
16+
[https://github.com/yajra/laravel-datatables](https://github.com/yajra/laravel-datatables)
17+
1218
## Installation
1319

1420
You can install the package via composer:
1521

1622
``` bash
17-
composer require rappasoft/livewire-tables
23+
composer require rappasoft/laravel-livewire-tables
1824
```
1925

2026
## Version Compatibility

src/Http/Livewire/Column.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ class Column
3737
*/
3838
protected $sortable = false;
3939

40+
/**
41+
* @var
42+
*/
43+
protected $sortCallback;
44+
4045
/**
4146
* @var bool
4247
*/
@@ -48,22 +53,17 @@ class Column
4853
protected $html = false;
4954

5055
/**
51-
* @var
56+
* This column is a custom attribute on the model and not a column in the database
57+
*
58+
* @var bool
5259
*/
53-
protected $sortCallback;
60+
protected $customAttribute = false;
5461

5562
/**
5663
* @var
5764
*/
5865
protected $view;
5966

60-
/**
61-
* This column is a custom attribute on the model and not a column in the database
62-
*
63-
* @var bool
64-
*/
65-
protected $customAttribute = false;
66-
6767
/**
6868
* Column constructor.
6969
*
@@ -168,35 +168,35 @@ public function isHtml() : bool {
168168
}
169169

170170
/**
171-
* @param $view
172-
*
173171
* @return $this
174172
*/
175-
public function view($view) : self
176-
{
177-
$this->view = $view;
173+
public function customAttribute() : self {
174+
$this->customAttribute = true;
178175
return $this;
179176
}
180177

181178
/**
182179
* @return bool
183180
*/
184-
public function isView() : bool {
185-
return view()->exists($this->view);
181+
public function isCustomAttribute() : bool {
182+
return $this->customAttribute;
186183
}
187184

188185
/**
186+
* @param $view
187+
*
189188
* @return $this
190189
*/
191-
public function customAttribute() : self {
192-
$this->customAttribute = true;
190+
public function view($view) : self
191+
{
192+
$this->view = $view;
193193
return $this;
194194
}
195195

196196
/**
197197
* @return bool
198198
*/
199-
public function isCustomAttribute() : bool {
200-
return $this->customAttribute;
199+
public function isView() : bool {
200+
return view()->exists($this->view);
201201
}
202202
}

0 commit comments

Comments
 (0)