From ef359501ba4d4cd72b07aa183be6338abfee0aea Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 13 May 2021 16:16:39 +1000 Subject: [PATCH] Export Controller --- app/Http/Controllers/ExportController.php | 64 +++++++++++++++++++ .../Requests/Export/StoreExportRequest.php | 39 +++++++++++ app/Mail/DownloadBackup.php | 41 ++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 app/Http/Controllers/ExportController.php create mode 100644 app/Http/Requests/Export/StoreExportRequest.php create mode 100644 app/Mail/DownloadBackup.php diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php new file mode 100644 index 000000000000..e2d99efa8e93 --- /dev/null +++ b/app/Http/Controllers/ExportController.php @@ -0,0 +1,64 @@ +user()->getCompany(), auth()->user()); + + return response()->json(['message' => 'Processing'], 200); + + } +} diff --git a/app/Http/Requests/Export/StoreExportRequest.php b/app/Http/Requests/Export/StoreExportRequest.php new file mode 100644 index 000000000000..96d322a53df6 --- /dev/null +++ b/app/Http/Requests/Export/StoreExportRequest.php @@ -0,0 +1,39 @@ +user()->isAdmin(); + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return []; + } +} diff --git a/app/Mail/DownloadBackup.php b/app/Mail/DownloadBackup.php new file mode 100644 index 000000000000..5b354a5db265 --- /dev/null +++ b/app/Mail/DownloadBackup.php @@ -0,0 +1,41 @@ +file_path = $file_path; + + $this->company = $company; + } + + /** + * Build the message. + */ + public function build() + { + return $this->from(config('mail.from.address'), config('mail.from.name')) + ->subject(ctrans('texts.download_backup_subject')) + ->markdown( + 'email.admin.download_files', + [ + 'url' => $this->file_path, + 'logo' => $this->company->present()->logo, + 'whitelabel' => $this->company->account->isPaid() ? true : false, + ] + ); + } +}