Skip to content

Commit dd36e12

Browse files
authored
Merge pull request #236 from berlisuharmanto/feature/modify-model
feat(model): Added modifyModelUsing to use custom model
2 parents 8b22caa + 6e7b51b commit dd36e12

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace pxlrbt\FilamentExcel\Exports\Concerns;
4+
5+
trait CanModifyModel
6+
{
7+
public function model(string $model): static
8+
{
9+
$this->model = $model;
10+
11+
return $this;
12+
}
13+
}

src/Exports/ExcelExport.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Maatwebsite\Excel\Events\BeforeSheet;
2525
use pxlrbt\FilamentExcel\Events\ExportFinishedEvent;
2626
use pxlrbt\FilamentExcel\Exports\Concerns\CanIgnoreFormatting;
27+
use pxlrbt\FilamentExcel\Exports\Concerns\CanModifyModel;
2728
use pxlrbt\FilamentExcel\Exports\Concerns\CanModifyQuery;
2829
use pxlrbt\FilamentExcel\Exports\Concerns\CanQueue;
2930
use pxlrbt\FilamentExcel\Exports\Concerns\Except;
@@ -45,6 +46,7 @@ class ExcelExport implements FromQuery, HasHeadings, HasMapping, ShouldAutoSize,
4546
use AskForFilename;
4647
use AskForWriterType;
4748
use CanIgnoreFormatting;
49+
use CanModifyModel;
4850
use CanModifyQuery;
4951
use CanQueue, Exportable {
5052
Exportable::download as downloadExport;

0 commit comments

Comments
 (0)