File tree Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Rappasoft \LaravelLivewireTables ;
4
4
5
+ use Illuminate \Database \Eloquent \Relations \Relation ;
5
6
use Illuminate \Database \Eloquent \Builder ;
6
7
use Illuminate \Pagination \LengthAwarePaginator ;
7
8
use Illuminate \Support \Collection ;
@@ -99,9 +100,9 @@ abstract public function columns(): array;
99
100
/**
100
101
* The base query with search and filters for the table.
101
102
*
102
- * @return Builder
103
+ * @return Builder|Relation
103
104
*/
104
- abstract public function query (): Builder ;
105
+ abstract public function query ();
105
106
106
107
/**
107
108
* TableComponent constructor.
@@ -124,9 +125,9 @@ public function __construct($id = null)
124
125
/**
125
126
* Get the rows query builder with sorting applied.
126
127
*
127
- * @return Builder
128
+ * @return Builder|Relation
128
129
*/
129
- public function rowsQuery (): Builder
130
+ public function rowsQuery ()
130
131
{
131
132
$ this ->cleanFilters ();
132
133
Original file line number Diff line number Diff line change 3
3
namespace Rappasoft \LaravelLivewireTables \Traits ;
4
4
5
5
use Illuminate \Database \Eloquent \Builder ;
6
+ use Illuminate \Database \Eloquent \Relations \Relation ;
6
7
7
8
/**
8
9
* Trait WithBulkActions.
@@ -58,13 +59,19 @@ public function resetBulk(): void
58
59
$ this ->selected = [];
59
60
}
60
61
61
- public function selectedRowsQuery (): Builder
62
+ /**
63
+ * @return Builder|Relation
64
+ */
65
+ public function selectedRowsQuery ()
62
66
{
63
67
return (clone $ this ->rowsQuery ())
64
68
->unless ($ this ->selectAll , fn ($ query ) => $ query ->whereIn ($ this ->primaryKey , $ this ->selected ));
65
69
}
66
70
67
- public function getSelectedRowsQueryProperty (): Builder
71
+ /**
72
+ * @return Builder|Relation
73
+ */
74
+ public function getSelectedRowsQueryProperty ()
68
75
{
69
76
return $ this ->selectedRowsQuery ();
70
77
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace Rappasoft \LaravelLivewireTables \Traits ;
4
4
5
+ use Illuminate \Database \Eloquent \Relations \Relation ;
5
6
use Illuminate \Database \Eloquent \Builder ;
6
7
use Rappasoft \LaravelLivewireTables \Utilities \ColumnUtilities ;
7
8
use Rappasoft \LaravelLivewireTables \Views \Column ;
@@ -253,10 +254,10 @@ public function getSearchableColumns() : array
253
254
/**
254
255
* Apply Search Filter
255
256
*
256
- * @param Builder $query
257
- * @return Builder
257
+ * @param Builder|Relation $query
258
+ * @return Builder|Relation
258
259
*/
259
- public function applySearchFilter (Builder $ query ): Builder
260
+ public function applySearchFilter ($ query )
260
261
{
261
262
$ searchableColumns = $ this ->getSearchableColumns ();
262
263
Original file line number Diff line number Diff line change 2
2
3
3
namespace Rappasoft \LaravelLivewireTables \Traits ;
4
4
5
+ use Illuminate \Database \Eloquent \Relations \Relation ;
5
6
use Illuminate \Database \Eloquent \Builder ;
6
7
7
8
/**
@@ -34,7 +35,12 @@ public function sortBy(string $field): ?string
34
35
return null ;
35
36
}
36
37
37
- public function applySorting (Builder $ query ): Builder
38
+ /**
39
+ * @param Builder|Relation $query
40
+ *
41
+ * @return Builder|Relation
42
+ */
43
+ public function applySorting ($ query )
38
44
{
39
45
foreach ($ this ->sorts as $ field => $ direction ) {
40
46
if (optional ($ this ->getColumn ($ field ))->hasSortCallback ()) {
You can’t perform that action at this time.
0 commit comments