Skip to content

Commit d205efc

Browse files
committed
minor update
1 parent afb76f1 commit d205efc

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

src/FastExcelLaravel/Excel.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ class Excel
99
*/
1010
public function __construct(?array $options = [])
1111
{
12-
1312
}
1413

1514
/**
16-
* @param $sheets
15+
* Create new XLSX-file for export
16+
*
17+
* @param array|string|null $sheets
1718
* @param array|null $options
1819
*
1920
* @return ExcelWriter
@@ -24,13 +25,15 @@ public static function create($sheets = null, ?array $options = []): ExcelWriter
2425
}
2526

2627
/**
27-
* @param $sheets
28+
* Open an existing XLSX-file for import
29+
*
30+
* @param string $file
2831
* @param array|null $options
2932
*
3033
* @return ExcelReader
3134
*/
32-
public static function open($sheets = null, ?array $options = []): ExcelReader
35+
public static function open(string $file, ?array $options = []): ExcelReader
3336
{
34-
return ExcelReader::open($sheets, $options);
37+
return ExcelReader::open($file, $options);
3538
}
3639
}

src/FastExcelLaravel/ExcelWriter.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,20 @@ public static function createSheet(string $sheetName): SheetWriter
5454
return new SheetWriter($sheetName);
5555
}
5656

57+
/**
58+
* @param $model
59+
* @param array|null $rowStyle
60+
* @param array|null $cellStyles
61+
*
62+
* @return $this
63+
*/
64+
public function exportModel($model, array $rowStyle = null, array $cellStyles = null): ExcelWriter
65+
{
66+
$this->getSheet()->exportModel($model, $rowStyle, $cellStyles);
67+
68+
return $this;
69+
}
70+
5771
/**
5872
* @param $data
5973
*

0 commit comments

Comments
 (0)