Skip to content

Commit

Permalink
Some cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Nov 8, 2021
1 parent dc91140 commit 03748e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions src/Exports/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@

class Export implements WithColumnFormatting, ShouldAutoSize, FromCollection, WithHeadings, WithMapping
{
protected $collection;

public function __construct($request)
public function collection()
{
$this->collection = QueryBuilder::for(Place::class)
return QueryBuilder::for(Place::class)
->allowedSorts(['id', 'status_translated', 'title_translated'])
->allowedFilters([
AllowedFilter::custom('title', new FilterOr()),
Expand Down Expand Up @@ -71,9 +69,4 @@ public function columnFormats(): array
'B' => NumberFormat::FORMAT_DATE_DATETIME,
];
}

public function collection()
{
return $this->collection;
}
}
2 changes: 1 addition & 1 deletion src/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function export(Request $request)
{
$filename = date('Y-m-d').' '.config('app.name').' places.xlsx';

return Excel::download(new Export($request), $filename);
return Excel::download(new Export(), $filename);
}

public function create(): View
Expand Down

0 comments on commit 03748e4

Please sign in to comment.