Class \avadim\FastExcelLaravel\Excel
On this page
- __construct() -- Excel constructor
- create() -- Create new XLSX-file for export
- open() -- Open an existing workbook (XLSX or legacy XLS) for import
- openString() -- Open a workbook held in a string for import
- openStream() -- Open a workbook from an open stream resource for import
__construct()
public function __construct(?array $options = [])
Excel constructor
Parameters
array|null $options
create()
public static function create($sheets, ?array $options = []): ExcelWriter
Create new XLSX-file for export
Parameters
array|string|null $sheetsarray|null $options
open()
public static function open(string $file, ?array $options = []): ExcelReader
Open an existing workbook (XLSX or legacy XLS) for import. The format is detected automatically from the file signature, so the file extension does not matter.
Parameters
string $filearray|null $options
openString()
public static function openString(string $content, ?array $options = []): ExcelReader
Open a workbook held in a string (a database blob, an HTTP response body, Storage::get(), …). The content
is written to a temporary file and opened like open(), so the format is detected from the bytes and
the same options apply. See Reading from a string or a stream.
Parameters
string $contentarray|null $options-- same as open()
openStream()
public static function openStream($stream, ?array $options = []): ExcelReader
Open a workbook from an open readable stream resource, e.g. \Storage::disk('s3')->readStream($path). The
stream is copied into a temporary file from its current position and opened like open(); it is not
closed. See Reading from a string or a stream.
Parameters
resource $streamarray|null $options-- same as open()