Skip to content
Patrick Brouwers edited this page May 14, 2015 · 7 revisions

Clerk has a lot of drivers for all different file types. You can easily swap them in the config:

Ledger::set('drivers.{reader/writer}.{type:csv/pdf/..}', '{name});

Ledger::set('drivers.reader.csv', 'SpreadsheetParser');
Ledger::set('drivers.writer.csv', 'SpreadsheetParser');

If you want to add your own impementation of existing drivers or add a new one, you can register a new driver. This driver should implement Maatwebsite\Clerk\Drivers\DriverInterface.

class CustomCsvDriver implement DriverInterface
{
     // Implement the DriverInterface methods
}

Ledger::register('reader.csv', function() {
    return new CustomCsvDriver();
});

The CustomCsvDriver is now registered and set as default. The system now knows where it can find the custom classes.

Excel

Readers

  • PHPExcel (default)
  • SpreadsheetParser

Writers

  • PHPExcel (default)

Csv

Readers

  • LeagueCsv (default)
  • PHPExcel
  • SpreadsheetParser

Writers

  • LeagueCsv (default)
  • PHPExcel

PDF

Readers

Writers

  • Snappy (default)

Word

Readers

  • PHPWord (default)

Writers

  • PHPWord (default)
Clone this wiki locally