excel.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. use Maatwebsite\Excel\Excel;
  3. return [
  4. 'exports' => [
  5. /*
  6. |--------------------------------------------------------------------------
  7. | Chunk size
  8. |--------------------------------------------------------------------------
  9. |
  10. | When using FromQuery, the query is automatically chunked.
  11. | Here you can specify how big the chunk should be.
  12. |
  13. */
  14. 'chunk_size' => 1000,
  15. /*
  16. |--------------------------------------------------------------------------
  17. | Temporary path
  18. |--------------------------------------------------------------------------
  19. |
  20. | When exporting files, we use a temporary file, before storing
  21. | or downloading. Here you can customize that path.
  22. |
  23. */
  24. 'temp_path' => sys_get_temp_dir(),
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Pre-calculate formulas during export
  28. |--------------------------------------------------------------------------
  29. */
  30. 'pre_calculate_formulas' => false,
  31. /*
  32. |--------------------------------------------------------------------------
  33. | CSV Settings
  34. |--------------------------------------------------------------------------
  35. |
  36. | Configure e.g. delimiter, enclosure and line ending for CSV exports.
  37. |
  38. */
  39. 'csv' => [
  40. 'delimiter' => ',',
  41. 'enclosure' => '"',
  42. 'line_ending' => PHP_EOL,
  43. 'use_bom' => false,
  44. 'include_separator_line' => false,
  45. 'excel_compatibility' => false,
  46. ],
  47. ],
  48. 'imports' => [
  49. 'read_only' => true,
  50. 'heading_row' => [
  51. /*
  52. |--------------------------------------------------------------------------
  53. | Heading Row Formatter
  54. |--------------------------------------------------------------------------
  55. |
  56. | Configure the heading row formatter.
  57. | Available options: none|slug|custom
  58. |
  59. */
  60. 'formatter' => 'slug',
  61. ],
  62. ],
  63. /*
  64. |--------------------------------------------------------------------------
  65. | Extension detector
  66. |--------------------------------------------------------------------------
  67. |
  68. | Configure here which writer type should be used when
  69. | the package needs to guess the correct type
  70. | based on the extension alone.
  71. |
  72. */
  73. 'extension_detector' => [
  74. 'xlsx' => Excel::XLSX,
  75. 'xlsm' => Excel::XLSX,
  76. 'xltx' => Excel::XLSX,
  77. 'xltm' => Excel::XLSX,
  78. 'xls' => Excel::XLS,
  79. 'xlt' => Excel::XLS,
  80. 'ods' => Excel::ODS,
  81. 'ots' => Excel::ODS,
  82. 'slk' => Excel::SLK,
  83. 'xml' => Excel::XML,
  84. 'gnumeric' => Excel::GNUMERIC,
  85. 'htm' => Excel::HTML,
  86. 'html' => Excel::HTML,
  87. 'csv' => Excel::CSV,
  88. 'tsv' => Excel::TSV,
  89. /*
  90. |--------------------------------------------------------------------------
  91. | PDF Extension
  92. |--------------------------------------------------------------------------
  93. |
  94. | Configure here which Pdf driver should be used by default.
  95. | Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF
  96. |
  97. */
  98. 'pdf' => Excel::DOMPDF,
  99. ],
  100. ];