diff --git a/.gitignore b/.gitignore index 73b644c..5c8d799 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ yarn-error.log /.idea /.vscode composer.lock +*.lock diff --git a/config/datatables-export.php b/config/datatables-export.php new file mode 100644 index 0000000..61014fe --- /dev/null +++ b/config/datatables-export.php @@ -0,0 +1,129 @@ + 'lazy', + + /* + |-------------------------------------------------------------------------- + | Chunk Size + |-------------------------------------------------------------------------- + | + | Chunk size to be used when using lazy method. + | + */ + 'chunk' => 1000, + + /* + |-------------------------------------------------------------------------- + | Export filesystem disk + |-------------------------------------------------------------------------- + | + | Export filesystem disk where generated files will be stored. + | + */ + 'disk' => 'local', + + /* + |-------------------------------------------------------------------------- + | Use S3 for final file destination + |-------------------------------------------------------------------------- + | + | After generating the file locally, it can be uploaded to s3. + | + */ + 's3_disk' => '', + + /* + |-------------------------------------------------------------------------- + | Mail from address + |-------------------------------------------------------------------------- + | + | Will be used to email report from this address. + | + */ + 'mail_from' => env('MAIL_FROM_ADDRESS', ''), + + /* + |-------------------------------------------------------------------------- + | Default Date Format + |-------------------------------------------------------------------------- + | + | Default export format for date. + | + */ + 'default_date_format' => 'yyyy-mm-dd', + + /* + |-------------------------------------------------------------------------- + | Valid Date Formats + |-------------------------------------------------------------------------- + | + | List of valid date formats to be used for auto-detection. + | + */ + 'date_formats' => [ + 'mm/dd/yyyy', + NumberFormat::FORMAT_DATE_DATETIME, + NumberFormat::FORMAT_DATE_YYYYMMDD, + NumberFormat::FORMAT_DATE_XLSX22, + NumberFormat::FORMAT_DATE_DDMMYYYY, + NumberFormat::FORMAT_DATE_DMMINUS, + NumberFormat::FORMAT_DATE_DMYMINUS, + NumberFormat::FORMAT_DATE_DMYSLASH, + NumberFormat::FORMAT_DATE_MYMINUS, + NumberFormat::FORMAT_DATE_TIME1, + NumberFormat::FORMAT_DATE_TIME2, + NumberFormat::FORMAT_DATE_TIME3, + NumberFormat::FORMAT_DATE_TIME4, + NumberFormat::FORMAT_DATE_TIME5, + NumberFormat::FORMAT_DATE_TIME6, + NumberFormat::FORMAT_DATE_TIME7, + NumberFormat::FORMAT_DATE_XLSX14, + NumberFormat::FORMAT_DATE_XLSX15, + NumberFormat::FORMAT_DATE_XLSX16, + NumberFormat::FORMAT_DATE_XLSX17, + NumberFormat::FORMAT_DATE_YYYYMMDD2, + NumberFormat::FORMAT_DATE_YYYYMMDDSLASH, + ], + + /* + |-------------------------------------------------------------------------- + | Valid Text Formats + |-------------------------------------------------------------------------- + | + | List of valid text formats to be used. + | + */ + 'text_formats' => [ + '@', + NumberFormat::FORMAT_GENERAL, + NumberFormat::FORMAT_TEXT, + ], + + /* + |-------------------------------------------------------------------------- + | Purge Options + |-------------------------------------------------------------------------- + | + | Purge all exported by purge.days old files. + | + */ + 'purge' => [ + 'days' => 1, + ], +]; diff --git a/database/migrations/2024_05_17_092901_create_job_batches_table.php b/database/migrations/2024_05_17_092901_create_job_batches_table.php new file mode 100644 index 0000000..50e38c2 --- /dev/null +++ b/database/migrations/2024_05_17_092901_create_job_batches_table.php @@ -0,0 +1,35 @@ +string('id')->primary(); + $table->string('name'); + $table->integer('total_jobs'); + $table->integer('pending_jobs'); + $table->integer('failed_jobs'); + $table->longText('failed_job_ids'); + $table->mediumText('options')->nullable(); + $table->integer('cancelled_at')->nullable(); + $table->integer('created_at'); + $table->integer('finished_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('job_batches'); + } +}; diff --git a/resources/views/vendor/datatables-export/export-button.blade.php b/resources/views/vendor/datatables-export/export-button.blade.php new file mode 100644 index 0000000..e7ca230 --- /dev/null +++ b/resources/views/vendor/datatables-export/export-button.blade.php @@ -0,0 +1,54 @@ +
+
+ +
+ + @if($exporting && $emailTo) + + @endif + + @if($exporting && !$exportFinished) + + @endif + + @if($exportFinished && !$exportFailed && !$autoDownload) + Done. Download file here + @endif + + @if($exportFinished && !$exportFailed && $autoDownload && $downloaded) + Done. File has been downloaded. + @endif + + @if($exportFailed) + Export failed, please try again later. + @endif +
diff --git a/resources/views/vendor/datatables-export/export-email.blade.php b/resources/views/vendor/datatables-export/export-email.blade.php new file mode 100644 index 0000000..1d1147b --- /dev/null +++ b/resources/views/vendor/datatables-export/export-email.blade.php @@ -0,0 +1 @@ +Attached you will find requested report.