Skip to content

Commit 0efce0c

Browse files
committed
fix: fast-excel install error message
1 parent 9ecfab9 commit 0efce0c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Services/DataTable.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ protected function buildExcelFile()
489489
}
490490

491491
if (! class_exists(ExcelServiceProvider::class)) {
492-
throw new Exception('Please install maatwebsite/excel to be able to use this function.');
492+
throw new Exception('Please composer require maatwebsite/excel to be able to use this function.');
493493
}
494494

495495
if (! new $this->exportClass instanceof DataTablesExportHandler) {
@@ -783,9 +783,14 @@ public function fastExcelCallback(): Closure
783783

784784
/**
785785
* @return \Rap2hpoutre\FastExcel\FastExcel
786+
* @throws \Yajra\DataTables\Exceptions\Exception
786787
*/
787788
protected function buildFastExcelFile(): FastExcel
788789
{
790+
if (! class_exists(FastExcel::class)) {
791+
throw new Exception('Please composer require rap2hpoutre/fast-excel to be able to use this function.');
792+
}
793+
789794
$query = null;
790795
if (method_exists($this, 'query')) {
791796
/** @var EloquentBuilder|QueryBuilder $query */

0 commit comments

Comments
 (0)