PHP code example of cbytedigital / laravel-bi-data-export
1. Go to this page and download the library: Download cbytedigital/laravel-bi-data-export library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cbytedigital / laravel-bi-data-export example snippets
class Client extends Model
{
use BiExportable;
// Default behaviour
public $biExportable = '*';
// Or select specific columns
public $biExportable = [
'id',
'username'
];
// Values of hidden fields will be replaced
public $biHidden = [
'first_name',
'last_name'
];
// Define the placeholder value for hidden fields.
// If not defined will resort to using the variable defined in the config.
public $biHiddenText = 'REDACTED';
}
return [
/**
* Define models for exporting
* ...
*/
'models' => [
\App\Models\Model::class
],
/**
* Define tables for exporting
* ...
*/
'tables' => [
'partners' => [
'columns' => '*'
]
],
/**
* Determines the export action. You can define your own implementation here.
*/
'export_job' => CbyteDigital\BiDataExport\Jobs\ExportBiToCsv::class,
/**
* Determines the export location.
*/
'export_disk' => env('BI_EXPORT_DISK', 's3'),
/**
* CSV export job delimiter value
*/
'export_csv_delimiter' => env('BI_EXPORT_CSV_DELIMITER', ';'),
/**
* Default replacement value if not overwritten by the model or tables config.
*/
'default_hidden_text' => env('BI_HIDDEN_TEXT', 'REDACTED'),
/**
* Ability to add a prefix to the filename. For example: {prefix}table.sql
*/
'filename_prefix' => env('BI_FILENAME_PREFIX'),
/**
* Ability to add a suffix to the filename. For example: table{suffix}.sql
*/
'filename_suffix' => env('BI_FILENAME_SUFFIX')
];