excel.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. <?php
  2. return array(
  3. 'cache' => array(
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Enable/Disable cell caching
  7. |--------------------------------------------------------------------------
  8. */
  9. 'enable' => true,
  10. /*
  11. |--------------------------------------------------------------------------
  12. | Caching driver
  13. |--------------------------------------------------------------------------
  14. |
  15. | Set the caching driver
  16. |
  17. | Available methods:
  18. | memory|gzip|serialized|igbinary|discISAM|apc|memcache|temp|wincache|sqlite|sqlite3
  19. |
  20. */
  21. 'driver' => 'memory',
  22. /*
  23. |--------------------------------------------------------------------------
  24. | Cache settings
  25. |--------------------------------------------------------------------------
  26. */
  27. 'settings' => array(
  28. 'memoryCacheSize' => '32MB',
  29. 'cacheTime' => 600
  30. ),
  31. /*
  32. |--------------------------------------------------------------------------
  33. | Memcache settings
  34. |--------------------------------------------------------------------------
  35. */
  36. 'memcache' => array(
  37. 'host' => 'localhost',
  38. 'port' => 11211,
  39. ),
  40. /*
  41. |--------------------------------------------------------------------------
  42. | Cache dir (for discISAM)
  43. |--------------------------------------------------------------------------
  44. */
  45. 'dir' => storage_path('cache')
  46. ),
  47. 'properties' => array(
  48. 'creator' => 'Maatwebsite',
  49. 'lastModifiedBy' => 'Maatwebsite',
  50. 'title' => 'Spreadsheet',
  51. 'description' => 'Default spreadsheet export',
  52. 'subject' => 'Spreadsheet export',
  53. 'keywords' => 'maatwebsite, excel, export',
  54. 'category' => 'Excel',
  55. 'manager' => 'Maatwebsite',
  56. 'company' => 'Maatwebsite',
  57. ),
  58. /*
  59. |--------------------------------------------------------------------------
  60. | Sheets settings
  61. |--------------------------------------------------------------------------
  62. */
  63. 'sheets' => array(
  64. /*
  65. |--------------------------------------------------------------------------
  66. | Default page setup
  67. |--------------------------------------------------------------------------
  68. */
  69. 'pageSetup' => array(
  70. 'orientation' => 'portrait',
  71. 'paperSize' => '9',
  72. 'scale' => '100',
  73. 'fitToPage' => false,
  74. 'fitToHeight' => true,
  75. 'fitToWidth' => true,
  76. 'columnsToRepeatAtLeft' => array('', ''),
  77. 'rowsToRepeatAtTop' => array(0, 0),
  78. 'horizontalCentered' => false,
  79. 'verticalCentered' => false,
  80. 'printArea' => null,
  81. 'firstPageNumber' => null,
  82. ),
  83. ),
  84. /*
  85. |--------------------------------------------------------------------------
  86. | Creator
  87. |--------------------------------------------------------------------------
  88. |
  89. | The default creator of a new Excel file
  90. |
  91. */
  92. 'creator' => 'Maatwebsite',
  93. 'csv' => array(
  94. /*
  95. |--------------------------------------------------------------------------
  96. | Delimiter
  97. |--------------------------------------------------------------------------
  98. |
  99. | The default delimiter which will be used to read out a CSV file
  100. |
  101. */
  102. 'delimiter' => ',',
  103. /*
  104. |--------------------------------------------------------------------------
  105. | Enclosure
  106. |--------------------------------------------------------------------------
  107. */
  108. 'enclosure' => '"',
  109. /*
  110. |--------------------------------------------------------------------------
  111. | Line endings
  112. |--------------------------------------------------------------------------
  113. */
  114. 'line_ending' => "\r\n"
  115. ),
  116. 'export' => array(
  117. /*
  118. |--------------------------------------------------------------------------
  119. | Autosize columns
  120. |--------------------------------------------------------------------------
  121. |
  122. | Disable/enable column autosize or set the autosizing for
  123. | an array of columns ( array('A', 'B') )
  124. |
  125. */
  126. 'autosize' => true,
  127. /*
  128. |--------------------------------------------------------------------------
  129. | Autosize method
  130. |--------------------------------------------------------------------------
  131. |
  132. | --> PHPExcel_Shared_Font::AUTOSIZE_METHOD_APPROX
  133. | The default is based on an estimate, which does its calculation based
  134. | on the number of characters in the cell value (applying any calculation
  135. | and format mask, and allowing for wordwrap and rotation) and with an
  136. | "arbitrary" adjustment based on the font (Arial, Calibri or Verdana,
  137. | defaulting to Calibri if any other font is used) and a proportional
  138. | adjustment for the font size.
  139. |
  140. | --> PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT
  141. | The second method is more accurate, based on actual style formatting as
  142. | well (bold, italic, etc), and is calculated by generating a gd2 imagettf
  143. | bounding box and using its dimensions to determine the size; but this
  144. | method is significantly slower, and its accuracy is still dependent on
  145. | having the appropriate fonts installed.
  146. |
  147. */
  148. 'autosize-method' => PHPExcel_Shared_Font::AUTOSIZE_METHOD_APPROX,
  149. /*
  150. |--------------------------------------------------------------------------
  151. | Auto generate table heading
  152. |--------------------------------------------------------------------------
  153. |
  154. | If set to true, the array indices (or model attribute names)
  155. | will automatically be used as first row (table heading)
  156. |
  157. */
  158. 'generate_heading_by_indices' => true,
  159. /*
  160. |--------------------------------------------------------------------------
  161. | Auto set alignment on merged cells
  162. |--------------------------------------------------------------------------
  163. */
  164. 'merged_cell_alignment' => 'left',
  165. /*
  166. |--------------------------------------------------------------------------
  167. | Pre-calculate formulas during export
  168. |--------------------------------------------------------------------------
  169. */
  170. 'calculate' => false,
  171. /*
  172. |--------------------------------------------------------------------------
  173. | Include Charts during export
  174. |--------------------------------------------------------------------------
  175. */
  176. 'includeCharts' => false,
  177. /*
  178. |--------------------------------------------------------------------------
  179. | Default sheet settings
  180. |--------------------------------------------------------------------------
  181. */
  182. 'sheets' => array(
  183. /*
  184. |--------------------------------------------------------------------------
  185. | Default page margin
  186. |--------------------------------------------------------------------------
  187. |
  188. | 1) When set to false, default margins will be used
  189. | 2) It's possible to enter a single margin which will
  190. | be used for all margins.
  191. | 3) Alternatively you can pass an array with 4 margins
  192. | Default order: array(top, right, bottom, left)
  193. |
  194. */
  195. 'page_margin' => false,
  196. /*
  197. |--------------------------------------------------------------------------
  198. | Value in source array that stands for blank cell
  199. |--------------------------------------------------------------------------
  200. */
  201. 'nullValue' => null,
  202. /*
  203. |--------------------------------------------------------------------------
  204. | Insert array starting from this cell address as the top left coordinate
  205. |--------------------------------------------------------------------------
  206. */
  207. 'startCell' => 'A1',
  208. /*
  209. |--------------------------------------------------------------------------
  210. | Apply strict comparison when testing for null values in the array
  211. |--------------------------------------------------------------------------
  212. */
  213. 'strictNullComparison' => false
  214. ),
  215. /*
  216. |--------------------------------------------------------------------------
  217. | Store settings
  218. |--------------------------------------------------------------------------
  219. */
  220. 'store' => array(
  221. /*
  222. |--------------------------------------------------------------------------
  223. | Path
  224. |--------------------------------------------------------------------------
  225. |
  226. | The path we want to save excel file to
  227. |
  228. */
  229. 'path' => storage_path('exports'),
  230. /*
  231. |--------------------------------------------------------------------------
  232. | Return info
  233. |--------------------------------------------------------------------------
  234. |
  235. | Whether we want to return information about the stored file or not
  236. |
  237. */
  238. 'returnInfo' => false
  239. ),
  240. /*
  241. |--------------------------------------------------------------------------
  242. | PDF Settings
  243. |--------------------------------------------------------------------------
  244. */
  245. 'pdf' => array(
  246. /*
  247. |--------------------------------------------------------------------------
  248. | PDF Drivers
  249. |--------------------------------------------------------------------------
  250. | Supported: DomPDF, tcPDF, mPDF
  251. */
  252. 'driver' => 'DomPDF',
  253. /*
  254. |--------------------------------------------------------------------------
  255. | PDF Driver settings
  256. |--------------------------------------------------------------------------
  257. */
  258. 'drivers' => array(
  259. /*
  260. |--------------------------------------------------------------------------
  261. | DomPDF settings
  262. |--------------------------------------------------------------------------
  263. */
  264. 'DomPDF' => array(
  265. 'path' => base_path('vendor/dompdf/dompdf/')
  266. ),
  267. /*
  268. |--------------------------------------------------------------------------
  269. | tcPDF settings
  270. |--------------------------------------------------------------------------
  271. */
  272. 'tcPDF' => array(
  273. 'path' => base_path('vendor/tecnick.com/tcpdf/')
  274. ),
  275. /*
  276. |--------------------------------------------------------------------------
  277. | mPDF settings
  278. |--------------------------------------------------------------------------
  279. */
  280. 'mPDF' => array(
  281. 'path' => base_path('vendor/mpdf/mpdf/')
  282. ),
  283. )
  284. )
  285. ),
  286. 'filters' => array(
  287. /*
  288. |--------------------------------------------------------------------------
  289. | Register read filters
  290. |--------------------------------------------------------------------------
  291. */
  292. 'registered' => array(
  293. 'chunk' => 'Maatwebsite\Excel\Filters\ChunkReadFilter'
  294. ),
  295. /*
  296. |--------------------------------------------------------------------------
  297. | Enable certain filters for every file read
  298. |--------------------------------------------------------------------------
  299. */
  300. 'enabled' => array()
  301. ),
  302. 'import' => array(
  303. /*
  304. |--------------------------------------------------------------------------
  305. | Has heading
  306. |--------------------------------------------------------------------------
  307. |
  308. | The sheet has a heading (first) row which we can use as attribute names
  309. |
  310. | Options: true|false|slugged|slugged_with_count|ascii|numeric|hashed|trans|original
  311. |
  312. */
  313. 'heading' => 'slugged',
  314. /*
  315. |--------------------------------------------------------------------------
  316. | First Row with data or heading of data
  317. |--------------------------------------------------------------------------
  318. |
  319. | If the heading row is not the first row, or the data doesn't start
  320. | on the first row, here you can change the start row.
  321. |
  322. */
  323. 'startRow' => 1,
  324. /*
  325. |--------------------------------------------------------------------------
  326. | Cell name word separator
  327. |--------------------------------------------------------------------------
  328. |
  329. | The default separator which is used for the cell names
  330. | Note: only applies to 'heading' settings 'true' && 'slugged'
  331. |
  332. */
  333. 'separator' => '_',
  334. /*
  335. |--------------------------------------------------------------------------
  336. | Include Charts during import
  337. |--------------------------------------------------------------------------
  338. */
  339. 'includeCharts' => false,
  340. /*
  341. |--------------------------------------------------------------------------
  342. | Sheet heading conversion
  343. |--------------------------------------------------------------------------
  344. |
  345. | Convert headings to ASCII
  346. | Note: only applies to 'heading' settings 'true' && 'slugged'
  347. |
  348. */
  349. 'to_ascii' => true,
  350. /*
  351. |--------------------------------------------------------------------------
  352. | Import encoding
  353. |--------------------------------------------------------------------------
  354. */
  355. 'encoding' => array(
  356. 'input' => 'UTF-8',
  357. 'output' => 'UTF-8'
  358. ),
  359. /*
  360. |--------------------------------------------------------------------------
  361. | Calculate
  362. |--------------------------------------------------------------------------
  363. |
  364. | By default cells with formulas will be calculated.
  365. |
  366. */
  367. 'calculate' => true,
  368. /*
  369. |--------------------------------------------------------------------------
  370. | Ignore empty cells
  371. |--------------------------------------------------------------------------
  372. |
  373. | By default empty cells are not ignored
  374. |
  375. */
  376. 'ignoreEmpty' => false,
  377. /*
  378. |--------------------------------------------------------------------------
  379. | Force sheet collection
  380. |--------------------------------------------------------------------------
  381. |
  382. | For a sheet collection even when there is only 1 sheets.
  383. | When set to false and only 1 sheet found, the parsed file will return
  384. | a row collection instead of a sheet collection.
  385. | When set to true, it will return a sheet collection instead.
  386. |
  387. */
  388. 'force_sheets_collection' => false,
  389. /*
  390. |--------------------------------------------------------------------------
  391. | Date format
  392. |--------------------------------------------------------------------------
  393. |
  394. | The format dates will be parsed to
  395. |
  396. */
  397. 'dates' => array(
  398. /*
  399. |--------------------------------------------------------------------------
  400. | Enable/disable date formatting
  401. |--------------------------------------------------------------------------
  402. */
  403. 'enabled' => true,
  404. /*
  405. |--------------------------------------------------------------------------
  406. | Default date format
  407. |--------------------------------------------------------------------------
  408. |
  409. | If set to false, a carbon object will return
  410. |
  411. */
  412. 'format' => false,
  413. /*
  414. |--------------------------------------------------------------------------
  415. | Date columns
  416. |--------------------------------------------------------------------------
  417. */
  418. 'columns' => array()
  419. ),
  420. /*
  421. |--------------------------------------------------------------------------
  422. | Import sheets by config
  423. |--------------------------------------------------------------------------
  424. */
  425. 'sheets' => array(
  426. /*
  427. |--------------------------------------------------------------------------
  428. | Example sheet
  429. |--------------------------------------------------------------------------
  430. |
  431. | Example sheet "test" will grab the firstname at cell A2
  432. |
  433. */
  434. 'test' => array(
  435. 'firstname' => 'A2'
  436. )
  437. )
  438. ),
  439. 'views' => array(
  440. /*
  441. |--------------------------------------------------------------------------
  442. | Styles
  443. |--------------------------------------------------------------------------
  444. |
  445. | The default styles which will be used when parsing a view
  446. |
  447. */
  448. 'styles' => array(
  449. /*
  450. |--------------------------------------------------------------------------
  451. | Table headings
  452. |--------------------------------------------------------------------------
  453. */
  454. 'th' => array(
  455. 'font' => array(
  456. 'bold' => true,
  457. 'size' => 12,
  458. )
  459. ),
  460. /*
  461. |--------------------------------------------------------------------------
  462. | Strong tags
  463. |--------------------------------------------------------------------------
  464. */
  465. 'strong' => array(
  466. 'font' => array(
  467. 'bold' => true,
  468. 'size' => 12,
  469. )
  470. ),
  471. /*
  472. |--------------------------------------------------------------------------
  473. | Bold tags
  474. |--------------------------------------------------------------------------
  475. */
  476. 'b' => array(
  477. 'font' => array(
  478. 'bold' => true,
  479. 'size' => 12,
  480. )
  481. ),
  482. /*
  483. |--------------------------------------------------------------------------
  484. | Italic tags
  485. |--------------------------------------------------------------------------
  486. */
  487. 'i' => array(
  488. 'font' => array(
  489. 'italic' => true,
  490. 'size' => 12,
  491. )
  492. ),
  493. /*
  494. |--------------------------------------------------------------------------
  495. | Heading 1
  496. |--------------------------------------------------------------------------
  497. */
  498. 'h1' => array(
  499. 'font' => array(
  500. 'bold' => true,
  501. 'size' => 24,
  502. )
  503. ),
  504. /*
  505. |--------------------------------------------------------------------------
  506. | Heading 2
  507. |--------------------------------------------------------------------------
  508. */
  509. 'h2' => array(
  510. 'font' => array(
  511. 'bold' => true,
  512. 'size' => 18,
  513. )
  514. ),
  515. /*
  516. |--------------------------------------------------------------------------
  517. | Heading 2
  518. |--------------------------------------------------------------------------
  519. */
  520. 'h3' => array(
  521. 'font' => array(
  522. 'bold' => true,
  523. 'size' => 13.5,
  524. )
  525. ),
  526. /*
  527. |--------------------------------------------------------------------------
  528. | Heading 4
  529. |--------------------------------------------------------------------------
  530. */
  531. 'h4' => array(
  532. 'font' => array(
  533. 'bold' => true,
  534. 'size' => 12,
  535. )
  536. ),
  537. /*
  538. |--------------------------------------------------------------------------
  539. | Heading 5
  540. |--------------------------------------------------------------------------
  541. */
  542. 'h5' => array(
  543. 'font' => array(
  544. 'bold' => true,
  545. 'size' => 10,
  546. )
  547. ),
  548. /*
  549. |--------------------------------------------------------------------------
  550. | Heading 6
  551. |--------------------------------------------------------------------------
  552. */
  553. 'h6' => array(
  554. 'font' => array(
  555. 'bold' => true,
  556. 'size' => 7.5,
  557. )
  558. ),
  559. /*
  560. |--------------------------------------------------------------------------
  561. | Hyperlinks
  562. |--------------------------------------------------------------------------
  563. */
  564. 'a' => array(
  565. 'font' => array(
  566. 'underline' => true,
  567. 'color' => array('argb' => 'FF0000FF'),
  568. )
  569. ),
  570. /*
  571. |--------------------------------------------------------------------------
  572. | Horizontal rules
  573. |--------------------------------------------------------------------------
  574. */
  575. 'hr' => array(
  576. 'borders' => array(
  577. 'bottom' => array(
  578. 'style' => 'thin',
  579. 'color' => array('FF000000')
  580. ),
  581. )
  582. )
  583. )
  584. )
  585. );