8 changed files with 117 additions and 10 deletions
-
52app/Http/Requests/BackupUploadRequest.php
-
3resources/lang/en/app.php
-
27resources/lang/en/backup.php
-
3resources/lang/id/app.php
-
27resources/lang/id/backup.php
-
8resources/views/backups/index.blade.php
-
6resources/views/layouts/app.blade.php
-
1resources/views/layouts/partials/nav.blade.php
@ -0,0 +1,52 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\Http\Requests; |
||||
|
|
||||
|
use Illuminate\Foundation\Http\FormRequest; |
||||
|
|
||||
|
class BackupUploadRequest extends FormRequest |
||||
|
{ |
||||
|
/** |
||||
|
* Determine if the user is authorized to make this request. |
||||
|
* |
||||
|
* @return bool |
||||
|
*/ |
||||
|
public function authorize() |
||||
|
{ |
||||
|
return auth()->check(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Get the validation rules that apply to the request. |
||||
|
* |
||||
|
* @return array |
||||
|
*/ |
||||
|
public function rules() |
||||
|
{ |
||||
|
return [ |
||||
|
'backup_file' => 'required|sql_gz', |
||||
|
]; |
||||
|
} |
||||
|
|
||||
|
public function messages() |
||||
|
{ |
||||
|
return [ |
||||
|
'backup_file.sql_gz' => 'Invalid file type, must be <strong>.gz</strong> file', |
||||
|
]; |
||||
|
} |
||||
|
|
||||
|
protected function getValidatorInstance() |
||||
|
{ |
||||
|
$validator = parent::getValidatorInstance(); |
||||
|
|
||||
|
$validator->addImplicitExtension('sql_gz', function ($attribute, $value, $parameters) { |
||||
|
if ($value) { |
||||
|
return $value->getClientOriginalExtension() == 'gz'; |
||||
|
} |
||||
|
|
||||
|
return false; |
||||
|
}); |
||||
|
|
||||
|
return $validator; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
<?php |
||||
|
|
||||
|
return [ |
||||
|
// Labels
|
||||
|
'index_title' => 'Database Backup Manager', |
||||
|
'list' => 'Backup File List', |
||||
|
'actions' => 'Actions', |
||||
|
'empty' => 'No backup file available.', |
||||
|
|
||||
|
// Actions
|
||||
|
'create' => 'Create Backup File', |
||||
|
'delete' => 'Delete this backup file', |
||||
|
'sure_to_delete_file' => 'Are you sure to delete this file <strong>":filename"</strong>?', |
||||
|
'confirm_delete' => 'YES, please delete this file!', |
||||
|
'cancel_delete' => 'Cancel Delete', |
||||
|
'restore' => 'Restore database from file', |
||||
|
'sure_to_restore' => 'Are you sure to restore database with this backup file "<strong>:filename</strong>"? <br><br>Please make sure your <strong>current database has been backed up</strong>.', |
||||
|
'confirm_restore' => 'YES, Restore Database!', |
||||
|
'cancel_restore' => 'Cancel Restore', |
||||
|
'download' => 'Download this file', |
||||
|
'upload' => 'Upload Backup File', |
||||
|
|
||||
|
// Attributes
|
||||
|
'file_name' => 'File Name', |
||||
|
'file_size' => 'File Size', |
||||
|
'created_at' => 'Created at', |
||||
|
]; |
||||
@ -0,0 +1,27 @@ |
|||||
|
<?php |
||||
|
|
||||
|
return [ |
||||
|
// Labels
|
||||
|
'index_title' => 'Database Backup Manager', |
||||
|
'list' => 'Daftar File Backup', |
||||
|
'actions' => 'Pilihan', |
||||
|
'empty' => 'Belum ada file backup.', |
||||
|
|
||||
|
// Actions
|
||||
|
'create' => 'Buat File Backup', |
||||
|
'delete' => 'Hapus file backup ini', |
||||
|
'sure_to_delete_file' => 'Anda yakin akan menghapus file <strong>":filename"</strong> ini?', |
||||
|
'confirm_delete' => 'YA, silakan hapus file ini!', |
||||
|
'cancel_delete' => 'Batal Hapus', |
||||
|
'restore' => 'Restore database dari file', |
||||
|
'sure_to_restore' => 'Anda yakin akan me-restore database dengan file backup ini "<strong>:filename</strong>"? <br><br>Harap dipastikan <strong>database saat ini sudah di-backup</strong>.', |
||||
|
'confirm_restore' => 'YA, Restore Database!', |
||||
|
'cancel_restore' => 'Batal Restore', |
||||
|
'download' => 'Download file ini', |
||||
|
'upload' => 'Upload File Backup', |
||||
|
|
||||
|
// Attributes
|
||||
|
'file_name' => 'Name File', |
||||
|
'file_size' => 'Ukuran File', |
||||
|
'created_at' => 'Dibuat pada', |
||||
|
]; |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue