Skip to content

Commit 03748e4

Browse files
committed
Some cleaning
1 parent dc91140 commit 03748e4

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/Exports/Export.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616

1717
class Export implements WithColumnFormatting, ShouldAutoSize, FromCollection, WithHeadings, WithMapping
1818
{
19-
protected $collection;
20-
21-
public function __construct($request)
19+
public function collection()
2220
{
23-
$this->collection = QueryBuilder::for(Place::class)
21+
return QueryBuilder::for(Place::class)
2422
->allowedSorts(['id', 'status_translated', 'title_translated'])
2523
->allowedFilters([
2624
AllowedFilter::custom('title', new FilterOr()),
@@ -71,9 +69,4 @@ public function columnFormats(): array
7169
'B' => NumberFormat::FORMAT_DATE_DATETIME,
7270
];
7371
}
74-
75-
public function collection()
76-
{
77-
return $this->collection;
78-
}
7972
}

src/Http/Controllers/AdminController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function export(Request $request)
2323
{
2424
$filename = date('Y-m-d').' '.config('app.name').' places.xlsx';
2525

26-
return Excel::download(new Export($request), $filename);
26+
return Excel::download(new Export(), $filename);
2727
}
2828

2929
public function create(): View

0 commit comments

Comments
 (0)