ibrahimtelman/voyager-excel-export

voyager excel export hook based voyager-excel package

1.0.1 2020-09-08 08:14 UTC

This package is auto-updated.

Last update: 2021-06-08 10:19:37 UTC


README

a plugin for excel export

Install hook

php artisan hook:install voyager-excel-export

Enable hook

php artisan hook:enable voyager-excel-export

Usage

Add traits to model

use ExcelExport;

Add setter method to model

public function setExportable()
{
  //list column of table which you want to export
  //type 1 ["key1", "key2"]
  //type 2 ["key1" => "New Name", "key2" => "New Name"]
  //or with closure ["key1" => [ "name" => "New Name", "value" => function($value, $model){ return $value } ]]
  //you all free to combine three options

  //example
  return array(
    "id", "fullname" => [
          "name" => "Name",
          "value" => function ($value, $model) {
              return strtoupper($value);
          }
      ], "email" => "Email", "phone" => "Phone"
  );
}

Support Language

  • tr
  • en
  • zh_CN (中文)

License

MIT

Links