├── .gitattributes ├── .gitignore ├── README.md ├── composer.json ├── config └── dotenveditor.php ├── resources ├── lang │ ├── az │ │ ├── class.php │ │ └── views.php │ ├── de │ │ ├── class.php │ │ └── views.php │ ├── en │ │ ├── class.php │ │ └── views.php │ ├── nl │ │ ├── class.php │ │ └── views.php │ ├── pl │ │ ├── class.php │ │ └── views.php │ ├── ru │ │ ├── class.php │ │ └── views.php │ └── vi │ │ ├── class.php │ │ └── views.php └── views │ ├── master.blade.php │ ├── overview-adminlte.blade.php │ └── overview.blade.php ├── routes └── web.php └── src ├── DotenvEditor.php ├── DotenvEditorFacade.php ├── DotenvEditorServiceProvider.php ├── Exceptions └── DotEnvException.php ├── Http └── Controllers │ └── EnvController.php └── Lang └── tr ├── class.php └── views.php /.gitattributes: -------------------------------------------------------------------------------- 1 | # Exclude fileswhen the package is downloaded. 2 | 3 | /images export-ignore 4 | /.gitignore export-ingore 5 | /.gitatributes 6 | /README.md export ignore 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #/images 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/26c13ba0918c42858ec6f94607238baa)](https://www.codacy.com/app/fabianhagen87/laravel-dotenv-editor?utm_source=github.com&utm_medium=referral&utm_content=Brotzka/laravel-dotenv-editor&utm_campaign=badger) 2 | [![Latest Stable Version](https://poser.pugx.org/brotzka/laravel-dotenv-editor/v/stable)](https://packagist.org/packages/brotzka/laravel-dotenv-editor) 3 | [![Total Downloads](https://poser.pugx.org/brotzka/laravel-dotenv-editor/downloads)](https://packagist.org/packages/brotzka/laravel-dotenv-editor) 4 | [![Latest Unstable Version](https://poser.pugx.org/brotzka/laravel-dotenv-editor/v/unstable)](https://packagist.org/packages/brotzka/laravel-dotenv-editor) 5 | [![License](https://poser.pugx.org/brotzka/laravel-dotenv-editor/license)](https://packagist.org/packages/brotzka/laravel-dotenv-editor) 6 | 7 | # Edit your Laravel .env file 8 | 9 | This package offers you the possibility to edit your .env dynamically through a controller or model. 10 | 11 | The current version (2.x) ships with a graphical user interface based on VueJS to offer you a very simple implementation of all features. 12 | 13 | List of available functions: 14 | - check, if a given key exists 15 | - get the value of a key 16 | - get the complete content of your .env 17 | - get the content as JSON 18 | - change existing values 19 | - add new key-value-pairs 20 | - delete existing key-value-pairs 21 | - create/restore/delete backups 22 | - list all backups 23 | - get the content of a backup 24 | - enable auto-backups 25 | - check, if auto-backups are enabled or not 26 | - get and set a backup-path 27 | 28 | 29 | Here are some images showing the gui which ships with the current version: 30 | 31 | ![Overview](https://github.com/Brotzka/laravel-dotenv-editor/blob/master/images/screenshot_01.png) 32 | ![Overview with loaded content](https://github.com/Brotzka/laravel-dotenv-editor/blob/master/images/screenshot_02.png) 33 | ![Edit an entry](https://github.com/Brotzka/laravel-dotenv-editor/blob/master/images/screenshot_08.png) 34 | ![Adding a new key-value-pair](https://github.com/Brotzka/laravel-dotenv-editor/blob/master/images/screenshot_03.png) 35 | ![Backups](https://github.com/Brotzka/laravel-dotenv-editor/blob/master/images/screenshot_04.png) 36 | ![Showing the content of a backup](https://github.com/Brotzka/laravel-dotenv-editor/blob/master/images/screenshot_06.png) 37 | ![More options for backups](https://github.com/Brotzka/laravel-dotenv-editor/blob/master/images/screenshot_07.png) 38 | ![Uploading Backups](https://github.com/Brotzka/laravel-dotenv-editor/blob/master/images/screenshot_05.png) 39 | 40 | 41 | # Installation 42 | 43 | Visit the [Wiki-page](https://github.com/Brotzka/laravel-dotenv-editor/wiki/Installation) to get more Information. 44 | 45 | 46 | ## Examples 47 | 48 | The following example shows an controller with a method, in which we change some values from the .env. 49 | Make sure, the entries you want to change, really exist in your .env. 50 | 51 | namespace App\Http\Controllers; 52 | 53 | use Brotzka\DotenvEditor\DotenvEditor; 54 | 55 | class EnvController extends Controller 56 | { 57 | public function test(){ 58 | $env = new DotenvEditor(); 59 | 60 | $env->changeEnv([ 61 | 'TEST_ENTRY1' => 'one_new_value', 62 | 'TEST_ENTRY2' => $anotherValue, 63 | ]); 64 | } 65 | } 66 | 67 | For more exmaples visit the Wiki. 68 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "brotzka/laravel-dotenv-editor", 3 | "description": "A package for editing the .env file in your Laravel root.", 4 | "keywords": ["laravel", "dotenv", "dotenv-editor"], 5 | "type": "library", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Fabian Hagen", 10 | "email": "fabianhagen87@gmail.com" 11 | } 12 | ], 13 | "minimum-stability": "stable", 14 | "require": { 15 | "php": ">=5.5.9" 16 | }, 17 | "autoload": { 18 | "psr-4": { 19 | "Brotzka\\DotenvEditor\\": "src/" 20 | } 21 | }, 22 | "extra": { 23 | "laravel": { 24 | "providers": [ 25 | "Brotzka\\DotenvEditor\\DotenvEditorServiceProvider" 26 | ], 27 | "aliases": { 28 | "DotenvEditor": "Brotzka\\DotenvEditor\\DotenvEditorFacade" 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /config/dotenveditor.php: -------------------------------------------------------------------------------- 1 | base_path('.env'), 19 | 'backupPath' => resource_path('backups/dotenv-editor/'), 20 | 'filePermissions' => env('FILE_PERMISSIONS', 0755), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | GUI-Settings 25 | |-------------------------------------------------------------------------- 26 | | 27 | | Here you can set the different parameter for the view, where you can edit 28 | | .env via a graphical interface. 29 | | 30 | | Comma-separate your different middlewares. 31 | | 32 | */ 33 | 34 | // Activate or deactivate the graphical interface 35 | 'activated' => true, 36 | 37 | /* Default view */ 38 | // 'template' => 'dotenv-editor::master', 39 | // 'overview' => 'dotenv-editor::overview', 40 | 41 | /* This is my custom view, do not using */ 42 | 'template' => 'adminlte::page', 43 | 'overview' => 'dotenv-editor::overview-adminlte', 44 | 45 | // Config route group 46 | 'route' => [ 47 | 'namespace' => 'Brotzka\DotenvEditor\Http\Controllers', 48 | 'prefix' => 'admin/env', 49 | 'as' => 'admin.env.', 50 | 'middleware' => ['web', 'admin'], 51 | ], 52 | ]; 53 | -------------------------------------------------------------------------------- /resources/lang/az/class.php: -------------------------------------------------------------------------------- 1 | 'İstədiyiniz dəyər yoxdur!', 18 | 'autobackup_wrong_value' => 'Bu funksiya üçün yalnız doğru və ya yanlış qəbul edilir!', 19 | 'requested_backup_not_found' => 'İstədiyiniz ehtiyat nüsxələri mövcud deyil!', 20 | 'no_backups_available' => 'Mövcud ehtiyat nüsxələri yoxdur!', 21 | 'backup_not_deletable' => 'Fayl tapılmadığı üçün ehtiyat nüsxəsi silindi!', 22 | 'array_needed' => 'Funksiya yalnız bir massiv qəbul edir!', 23 | 'numeric_array_needed' => 'Funksiya yalnız silinəbilən açarlardan ibarət ədədi massiv qəbul edir!' 24 | ]; 25 | -------------------------------------------------------------------------------- /resources/lang/az/views.php: -------------------------------------------------------------------------------- 1 | 'Ümumi baxış', 15 | 'addnew' => 'Yenisini əlavə edin', 16 | 'backups' => 'Ehtiyat Nüsxələri', 17 | 'upload' => 'Yüklə', 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Title 22 | |-------------------------------------------------------------------------- 23 | */ 24 | 'title' => '.env-Editor', 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | View overview 29 | |-------------------------------------------------------------------------- 30 | */ 31 | 'overview_title' => 'Cari .env-faylınız', 32 | 'overview_text' => 'Burada cari aktiv .env. Məzmununuzu görə bilərsiniz. Məzmunu göstərmək üçün yükləyin vurun.', 33 | 'overview_button' => 'Yükləyin', 34 | 'overview_table_key' => 'Açar', 35 | 'overview_table_value' => 'Dəyər', 36 | 'overview_table_options' => 'Seçimlər', 37 | 'overview_table_popover_edit' => 'Girişləri redaktə edin', 38 | 'overview_table_popover_delete' => 'Girişi silmək', 39 | 'overview_delete_modal_text' => 'Bu girişi həqiqətən silmək istəyirsiniz?', 40 | 'overview_delete_modal_yes' => 'Bəli, girişi silin', 41 | 'overview_delete_modal_no' => 'Xeyr, çıxın', 42 | 'overview_edit_modal_title' => 'Girişləri redaktə edin', 43 | 'overview_edit_modal_save' => 'Yadda saxla', 44 | 'overview_edit_modal_quit' => 'Dayandırmaq', 45 | 'overview_edit_modal_value' => 'Yeni dəyər', 46 | 'overview_edit_modal_key' => 'Açar', 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | View add new 51 | |-------------------------------------------------------------------------- 52 | */ 53 | 'addnew_title' => 'Yeni açar-dəyər cütü əlavə edin', 54 | 'addnew_text' => 'Burada cari .env-faylınıza yeni açar-dəyər cütü əlavə edə bilərsiniz.', 55 | 'addnew_label_key' => 'Açar', 56 | 'addnew_label_value'=> 'Dəyər', 57 | 'addnew_button_add' => 'Əlavə edin', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | View backup 62 | |-------------------------------------------------------------------------- 63 | */ 64 | 'backup_title_one' => 'Cari .env faylınızı qeyd edin', 65 | 'backup_create' => 'Ehtiyat nüsxəsi yaradın', 66 | 'backup_download' => 'Cari .env faylınızı yükləyin', 67 | 'backup_title_two' => 'Mövcud ehtiyat nüsxələriniz', 68 | 'backup_restore_text' => 'Burada mövcud ehtiyat nüsxələrdən birini bərpa edə bilərsiniz.', 69 | 'backup_restore_warning' => 'Bu aktiv .env faylının üzərinə yazır. Hal-hazırda fəaliyyət göstərən .env faylın ehtiyat nüsxəsini çıxarmağınızdan əmin olun!', 70 | 'backup_no_backups' => 'Ehtiyat nüsxələriniz yoxdur.', 71 | 'backup_table_nr' => '№', 72 | 'backup_table_date' => 'Tarix', 73 | 'backup_table_options' => 'Seçimlər', 74 | 'backup_table_options_show' => 'Ehtiyat nüsxələrinin məzmununu göstərin', 75 | 'backup_table_options_restore' => 'Bu versiyanı yenidən bərpa edin', 76 | 'backup_table_options_download' => 'Bu versiyanı yükləyin', 77 | 'backup_table_options_delete' => 'Bu versiyanı silin', 78 | 'backup_modal_title' => 'Ehtiyat nüsxələrinin məzmunu', 79 | 'backup_modal_key' => 'Açar', 80 | 'backup_modal_value' => 'Dəyər', 81 | 'backup_modal_close' => 'Bağla', 82 | 'backup_modal_restore' => 'Yenidən bərpa et', 83 | 'backup_modal_delete' => 'Sil', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | View upload 88 | |-------------------------------------------------------------------------- 89 | */ 90 | 'upload_title' => 'Bir ehtiyat nüsxəsi yüklə', 91 | 'upload_text' => 'Burada kompüterinizdən bir ehtiyat nüsxəsi yükləyə bilərsiniz.', 92 | 'upload_warning'=> ' Diqqət: Bu, hazırda fəaliyyət göstərən .env faylın üzərinə yazacaqdır. Yükləmədən əvvəl bir ehtiyat nüsxəsi yaratmağınızdan əmin olun.', 93 | 'upload_label' => 'Fayl seçin', 94 | 'upload_button' => 'Yükləyin', 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Messages from View 99 | |-------------------------------------------------------------------------- 100 | */ 101 | 'new_entry_added' => 'Yeni açar-dəyər cütlüyü .env-ə uğurla əlavə edildi.', 102 | 'entry_edited' => 'Açar-dəyər cütü uğurla düzəldildi!', 103 | 'entry_deleted' => 'Açar-dəyər cütü uğurla silindi!', 104 | 'delete_entry' => 'Girişi silmək', 105 | 'backup_created' => 'Ehtiyat nüsxəsi uğurla yaradıldı!', 106 | 'backup_restored' => 'Ehtiyat nüsxəsi uğurla bərpa edildi!', 107 | 108 | /* 109 | |-------------------------------------------------------------------------- 110 | | Messages from Controller 111 | |-------------------------------------------------------------------------- 112 | */ 113 | 'controller_backup_deleted' => 'Ehtiyat nüsxəsi uğurla yaradıldı!', 114 | 'controller_backup_created' => 'Ehtiyat nüsxəsi uğurla bərpa edildi!', 115 | ]; 116 | -------------------------------------------------------------------------------- /resources/lang/de/class.php: -------------------------------------------------------------------------------- 1 | 'Der angeforderte Wert existiert nicht!', 20 | 'autobackup_wrong_value' => 'Diese Mehtode akzeptiert nur true oder false!', 21 | 'requested_backup_not_found' => 'Das angeforderte Backup existiert nicht!', 22 | 'no_backups_available' => 'Keine Backups verfügbar!', 23 | 'backup_not_deletable' => 'Backup konnte nicht gelöscht werden, da die Datei nicht existiert!', 24 | 'array_needed' => 'Diese Methode akzeptiert nur ein Array!', 25 | 'numeric_array_needed' => 'Diese Methode akzeptiert nur ein numerisches Array mit den zu löschenden Schlüsseln!' 26 | ]; 27 | -------------------------------------------------------------------------------- /resources/lang/de/views.php: -------------------------------------------------------------------------------- 1 | 'Übersicht', 16 | 'addnew' => 'neuer Eintrag', 17 | 'backups' => 'Backups', 18 | 'upload' => 'Upload', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Title 23 | |-------------------------------------------------------------------------- 24 | */ 25 | 'title' => '.env-Editor', 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | View overview 30 | |-------------------------------------------------------------------------- 31 | */ 32 | 'overview_title' => 'Deine aktuelle .env-Datei', 33 | 'overview_text' => 'Hier siehst du den Inhalt deiner aktiven .env-Datei.
Klicke auf laden um den Inhalt anzuzeigen.', 34 | 'overview_button' => 'Laden', 35 | 'overview_table_key' => 'Schlüssel', 36 | 'overview_table_value' => 'Wert', 37 | 'overview_table_options' => 'Optionen', 38 | 'overview_table_popover_edit' => 'Eintrag bearbeiten', 39 | 'overview_table_popover_delete' => 'Eintrag löschen', 40 | 'overview_delete_modal_text' => 'Willst du diesen Eintrag wirklich löschen?', 41 | 'overview_delete_modal_yes' => 'Ja, Eintrag löschen', 42 | 'overview_delete_modal_no' => 'Nein, abbrechen', 43 | 'overview_edit_modal_title' => 'Eintrag bearbeiten', 44 | 'overview_edit_modal_save' => 'Speichern', 45 | 'overview_edit_modal_quit' => 'Abbrechen', 46 | 'overview_edit_modal_value' => 'Neuer Wert', 47 | 'overview_edit_modal_key' => 'Schlüssel', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | View add new 52 | |-------------------------------------------------------------------------- 53 | */ 54 | 'addnew_title' => 'Füge ein neues Schlüssel-Wert-Paar hinzu', 55 | 'addnew_text' => 'Hier kannst du einen neuen Eintrag zu deiner aktuellen .env-Datei hinzufügen.
Sicherheitshalber kannst du unter Backups eine Sicherung erstellen.', 56 | 'addnew_label_key' => 'Schlüssel', 57 | 'addnew_label_value'=> 'Wert', 58 | 'addnew_button_add' => 'Hinzufügen', 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | View backup 63 | |-------------------------------------------------------------------------- 64 | */ 65 | 'backup_title_one' => 'Speicher deine aktuelle .env-Datei', 66 | 'backup_create' => 'Backup erstellen', 67 | 'backup_download' => 'aktuelle .env-Datei runterladen', 68 | 'backup_title_two' => 'Deine verfügbaren Backups', 69 | 'backup_restore_text' => 'Hier kannst du verfügabre Backups wieder herstellen.', 70 | 'backup_restore_warning' => 'Dies überschreibt deine aktuell aktive .env! Erstelle zuvor sicherheitshalber ein Backup!', 71 | 'backup_no_backups' => 'Keine Backups verfügbar.', 72 | 'backup_table_nr' => 'Nr.', 73 | 'backup_table_date' => 'Datum', 74 | 'backup_table_options' => 'Optionen', 75 | 'backup_table_options_show' => 'Inhalt des Backups anzeigen', 76 | 'backup_table_options_restore' => 'Dieses backup wiederherstellen', 77 | 'backup_table_options_download' => 'Backup runterladen', 78 | 'backup_table_options_delete' => 'Backup löschen', 79 | 'backup_modal_title' => 'Inhalt des Backups', 80 | 'backup_modal_key' => 'Schlüssel', 81 | 'backup_modal_value' => 'Wert', 82 | 'backup_modal_close' => 'Schließen', 83 | 'backup_modal_restore' => 'Wiederherstellen', 84 | 'backup_modal_delete' => 'Löschen', 85 | 86 | /* 87 | |-------------------------------------------------------------------------- 88 | | View upload 89 | |-------------------------------------------------------------------------- 90 | */ 91 | 'upload_title' => 'Backup hochladen', 92 | 'upload_text' => 'Hier kannst du ein Backup von deinem Computer hochladen.', 93 | 'upload_warning'=> 'Achtung: Dies überschreibt deine aktuell aktive .env! Erstelle sicherheitshalber ein Backup!', 94 | 'upload_label' => 'Datei auswählen', 95 | 'upload_button' => 'Hochladen', 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Messages from View 100 | |-------------------------------------------------------------------------- 101 | */ 102 | 'new_entry_added' => 'Neues Schlüssel-Wert-Paar wurde erfolgreich hinzugefügt.', 103 | 'entry_edited' => 'Schlüssel-Wert-Paar wurde erfolgreich geändert.', 104 | 'entry_deleted' => 'Schlüssel-Wert-Paar wurde erfolgreich gelöscht.', 105 | 'delete_entry' => 'Eintrag löschen', 106 | 'backup_created' => 'Neues Backup wurde erfolgreich erstellt.', 107 | 'backup_restored' => 'Backup wurde erfolgreich wieder hergestellt.', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Messages from Controller 112 | |-------------------------------------------------------------------------- 113 | */ 114 | 'controller_backup_deleted' => 'Backup wurde erfolgreich gelöscht.', 115 | 'controller_backup_created' => 'Backup wurde erfolgreich erstellt.' 116 | ]; 117 | -------------------------------------------------------------------------------- /resources/lang/en/class.php: -------------------------------------------------------------------------------- 1 | 'The value you requested does not exist!', 19 | 'autobackup_wrong_value' => 'Only true or false is accepted for this function!', 20 | 'requested_backup_not_found' => 'The backup you requested does not exist!', 21 | 'no_backups_available' => 'There are no available backups!', 22 | 'backup_not_deletable' => 'Backup could not be deleted because file was not found!', 23 | 'array_needed' => 'Function does only accept an array!', 24 | 'numeric_array_needed' => 'Function does only accept a numeric array containing only the deletable keys!' 25 | ]; 26 | -------------------------------------------------------------------------------- /resources/lang/en/views.php: -------------------------------------------------------------------------------- 1 | 'Overview', 16 | 'addnew' => 'Add New', 17 | 'backups' => 'Backups', 18 | 'upload' => 'Upload', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Title 23 | |-------------------------------------------------------------------------- 24 | */ 25 | 'title' => '.env-Editor', 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | View overview 30 | |-------------------------------------------------------------------------- 31 | */ 32 | 'overview_title' => 'Your current .env-file', 33 | 'overview_text' => 'Here you can see the content of your current active .env.
Click load to show the content.', 34 | 'overview_button' => 'Load', 35 | 'overview_table_key' => 'Key', 36 | 'overview_table_value' => 'Value', 37 | 'overview_table_options' => 'Options', 38 | 'overview_table_popover_edit' => 'Edit entry', 39 | 'overview_table_popover_delete' => 'Delete entry', 40 | 'overview_delete_modal_text' => 'Do you really want to delete this entry?', 41 | 'overview_delete_modal_yes' => 'Yes, delete entry', 42 | 'overview_delete_modal_no' => 'No, quit', 43 | 'overview_edit_modal_title' => 'Edit entry', 44 | 'overview_edit_modal_save' => 'Save', 45 | 'overview_edit_modal_quit' => 'Abort', 46 | 'overview_edit_modal_value' => 'New value', 47 | 'overview_edit_modal_key' => 'Key', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | View add new 52 | |-------------------------------------------------------------------------- 53 | */ 54 | 'addnew_title' => 'Add new key-value-pair', 55 | 'addnew_text' => 'Here you can add a new key-value-pair to your current .env-file.
To be sure, create a backup before under the backup-tab.', 56 | 'addnew_label_key' => 'Key', 57 | 'addnew_label_value'=> 'Value', 58 | 'addnew_button_add' => 'Add', 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | View backup 63 | |-------------------------------------------------------------------------- 64 | */ 65 | 'backup_title_one' => 'Save your current .env-file', 66 | 'backup_create' => 'Create Backup', 67 | 'backup_download' => 'Download Current .env', 68 | 'backup_title_two' => 'Your available backups', 69 | 'backup_restore_text' => 'Here you can restore one of your available backups.', 70 | 'backup_restore_warning' => 'This overwrites your active .env! Be sure to backup your currently active .env-file!', 71 | 'backup_no_backups' => 'You have no backups available.', 72 | 'backup_table_nr' => 'Nr.', 73 | 'backup_table_date' => 'Date', 74 | 'backup_table_options' => 'Options', 75 | 'backup_table_options_show' => 'Show content of backup', 76 | 'backup_table_options_restore' => 'Restore this version', 77 | 'backup_table_options_download' => 'Download this version', 78 | 'backup_table_options_delete' => 'Delete this version', 79 | 'backup_modal_title' => 'Content of backup', 80 | 'backup_modal_key' => 'Key', 81 | 'backup_modal_value' => 'Value', 82 | 'backup_modal_close' => 'Close', 83 | 'backup_modal_restore' => 'Restore', 84 | 'backup_modal_delete' => 'Delete', 85 | 86 | /* 87 | |-------------------------------------------------------------------------- 88 | | View upload 89 | |-------------------------------------------------------------------------- 90 | */ 91 | 'upload_title' => 'Upload a backup', 92 | 'upload_text' => 'Here you can upload a backup from your computer.', 93 | 'upload_warning'=> 'Warning: This will override your currently active .env-file. Be sure, to create a backup before uploading.', 94 | 'upload_label' => 'Pick a file', 95 | 'upload_button' => 'Upload', 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Messages from View 100 | |-------------------------------------------------------------------------- 101 | */ 102 | 'new_entry_added' => 'New key-value-pair was successfully added to your .env!', 103 | 'entry_edited' => 'Key-value-pair was edited successfully!', 104 | 'entry_deleted' => 'Key-value-pair was deleted successfully!', 105 | 'delete_entry' => 'Delete an entry', 106 | 'backup_created' => 'New backup was created successfully!', 107 | 'backup_restored' => 'Backup was restored successfully!', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Messages from Controller 112 | |-------------------------------------------------------------------------- 113 | */ 114 | 'controller_backup_deleted' => 'Backup was deleted successfully!', 115 | 'controller_backup_created' => 'Backup was created successfully!' 116 | ]; 117 | -------------------------------------------------------------------------------- /resources/lang/nl/class.php: -------------------------------------------------------------------------------- 1 | 'De waarde die u zocht kan niet gevonden worden!', 19 | 'autobackup_wrong_value' => 'Alleen true of false kan gebruikt worden voor deze functie!', 20 | 'requested_backup_not_found' => 'De gevraagde backup bestaat niet!', 21 | 'no_backups_available' => 'Er zijn geen backups gevonden!', 22 | 'backup_not_deletable' => 'De backup kan niet worden verwijderd omdat er geen bestand is gevonden!', 23 | 'array_needed' => 'De functie kan alleen een array bevatten!', 24 | 'numeric_array_needed' => 'Deze functie werkt alleen met een numerieke array bestaande uit verwijderbare sleutels!' 25 | ]; 26 | -------------------------------------------------------------------------------- /resources/lang/nl/views.php: -------------------------------------------------------------------------------- 1 | 'Overzicht', 16 | 'addnew' => 'Toevoegen', 17 | 'backups' => 'Backups', 18 | 'upload' => 'Uploaden', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Title 23 | |-------------------------------------------------------------------------- 24 | */ 25 | 'title' => '.env-Editor', 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | View overview 30 | |-------------------------------------------------------------------------- 31 | */ 32 | 'overview_title' => ' .env-file', 33 | 'overview_text' => 'Hier kunt u de inhoud van uw huidige actieve .env zien.
Klik op laden om de inhoud te laten zien.', 34 | 'overview_button' => 'Laden', 35 | 'overview_table_key' => 'Sleutel', 36 | 'overview_table_value' => 'Waarde', 37 | 'overview_table_options' => 'Opties', 38 | 'overview_table_popover_edit' => 'Wijzig waarde', 39 | 'overview_table_popover_delete' => 'Verwijder waarde', 40 | 'overview_delete_modal_text' => 'Bent u zeker dat u deze waarde wilt verwijderen?', 41 | 'overview_delete_modal_yes' => 'Ja, Verwijder waarde', 42 | 'overview_delete_modal_no' => 'Nee, eindig', 43 | 'overview_edit_modal_title' => 'Wijzig waarde', 44 | 'overview_edit_modal_save' => 'Opslaan', 45 | 'overview_edit_modal_quit' => 'Annuleren', 46 | 'overview_edit_modal_value' => 'Nieuwe waarde', 47 | 'overview_edit_modal_key' => 'Sleutel', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | View add new 52 | |-------------------------------------------------------------------------- 53 | */ 54 | 'addnew_title' => 'Voeg een nieuwe sleutel en waarde toe.', 55 | 'addnew_text' => 'Hier kunt u een nieuwe sleutel-waarde-paar toe te voegen aan uw actuele .env-file.
Om zeker te zijn, voordat een back-up in het kader van de back-up-tabblad.', 56 | 'addnew_label_key' => 'Sleutel', 57 | 'addnew_label_value'=> 'Waarde', 58 | 'addnew_button_add' => 'Toevoegen', 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | View backup 63 | |-------------------------------------------------------------------------- 64 | */ 65 | 'backup_title_one' => 'Sla uw huidige .env bastand op.', 66 | 'backup_create' => 'créér een Backup', 67 | 'backup_download' => 'Download Current .env', 68 | 'backup_title_two' => 'Your available backups', 69 | 'backup_restore_text' => 'Here you can restore one of your available backups.', 70 | 'backup_restore_warning' => 'This overwrites your active .env! Be sure to backup your currently active .env-file!', 71 | 'backup_no_backups' => 'You have no backups available.', 72 | 'backup_table_nr' => 'Nr.', 73 | 'backup_table_date' => 'Datum', 74 | 'backup_table_options' => 'Opties', 75 | 'backup_table_options_show' => 'Geef inhoud van de backup weer.', 76 | 'backup_table_options_restore' => 'Restore this version', 77 | 'backup_table_options_download' => 'Download deze versie', 78 | 'backup_table_options_delete' => 'Verwijder deze version', 79 | 'backup_modal_title' => 'Inhoud van de backup', 80 | 'backup_modal_key' => 'Sleutel', 81 | 'backup_modal_value' => 'Waarde', 82 | 'backup_modal_close' => 'Sluit', 83 | 'backup_modal_restore' => 'Herstel', 84 | 'backup_modal_delete' => 'Verwijder', 85 | 86 | /* 87 | |-------------------------------------------------------------------------- 88 | | View upload 89 | |-------------------------------------------------------------------------- 90 | */ 91 | 'upload_title' => 'Upload een backip', 92 | 'upload_text' => 'Hier kunt een backup uploaden vanaf jouw computer.', 93 | 'upload_warning'=> 'Waarschuwing: Dit zal je actieve .env-bestand overschrijven. Zorg ervoor, om een ​​back-up voordat het uploaden van te maken.', 94 | 'upload_label' => 'Kies een bestand.', 95 | 'upload_button' => 'Upload', 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Messages from View 100 | |-------------------------------------------------------------------------- 101 | */ 102 | 'new_entry_added' => 'Het nieuwe item is succesvol opgeslagen in je .env bestand!', 103 | 'entry_edited' => 'Item succesvol gewijzigd!!', 104 | 'entry_deleted' => 'Item succesvol verwijderd!', 105 | 'delete_entry' => 'Verwijder een item', 106 | 'backup_created' => 'De niewe backup is gecréérd!', 107 | 'backup_restored' => 'De backup herstel is gelukt!', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Messages from Controller 112 | |-------------------------------------------------------------------------- 113 | */ 114 | 'controller_backup_deleted' => 'De backup is verwijderd!', 115 | 'controller_backup_created' => 'De backup is gecréérd!' 116 | ]; 117 | -------------------------------------------------------------------------------- /resources/lang/pl/class.php: -------------------------------------------------------------------------------- 1 | 'Rządana wartość nie istnieje!', 19 | 'autobackup_wrong_value' => 'Tylko true lub false jest akceptowane dla tej funkcji!', 20 | 'requested_backup_not_found' => 'Rządana kopia nie istnieje!', 21 | 'no_backups_available' => 'Brak dostępnych kopii!', 22 | 'backup_not_deletable' => 'Kopia nie mogłą zaostać usunięta ponieważ plik nie istnieje!', 23 | 'array_needed' => 'Ta funkcja przyjmuje tylko tablice!', 24 | 'numeric_array_needed' => 'Funkcja akceptuje tylko tablicę numeryczną zawierającą tylko klucze do usunięcia!' 25 | ]; 26 | -------------------------------------------------------------------------------- /resources/lang/pl/views.php: -------------------------------------------------------------------------------- 1 | 'Przegląd', 16 | 'addnew' => 'Nowy rekord', 17 | 'backups' => 'Kopie zapasowe', 18 | 'upload' => 'Prześlij', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Title 23 | |-------------------------------------------------------------------------- 24 | */ 25 | 'title' => '.env-Editor', 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | View overview 30 | |-------------------------------------------------------------------------- 31 | */ 32 | 'overview_title' => 'Aktualny plik .env', 33 | 'overview_text' => 'Kliknij Załaduj aby wczytać bieżący plik .env.', 34 | 'overview_button' => 'Załaduj', 35 | 'overview_table_key' => 'Klucz', 36 | 'overview_table_value' => 'Wartość', 37 | 'overview_table_options' => 'Opcje', 38 | 'overview_table_popover_edit' => 'Edytuj wpis', 39 | 'overview_table_popover_delete' => 'Skasuj wpis', 40 | 'overview_delete_modal_text' => 'Czy na pewno chcesz usunąć ten wpis?', 41 | 'overview_delete_modal_yes' => 'Tak, usuń wpis', 42 | 'overview_delete_modal_no' => 'Nie, wyjdź', 43 | 'overview_edit_modal_title' => 'Edycja', 44 | 'overview_edit_modal_save' => 'Zapisz', 45 | 'overview_edit_modal_quit' => 'Anuluj', 46 | 'overview_edit_modal_value' => 'Nowa wartość', 47 | 'overview_edit_modal_key' => 'Klucz', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | View add new 52 | |-------------------------------------------------------------------------- 53 | */ 54 | 'addnew_title' => 'Dodaj nową parę klucz-wartość', 55 | 'addnew_text' => 'Tutaj możesz dodać nową parę klucz-wartość do aktualnego pliku .env.
Upewnij się, że wykonałeś kopie zapasową.', 56 | 'addnew_label_key' => 'Klucz', 57 | 'addnew_label_value'=> 'Wartość', 58 | 'addnew_button_add' => 'Dodaj', 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | View backup 63 | |-------------------------------------------------------------------------- 64 | */ 65 | 'backup_title_one' => 'Zapisz aktualny plik .env', 66 | 'backup_create' => 'Wykonaj kopie', 67 | 'backup_download' => 'Pobierz aktualny plik .env', 68 | 'backup_title_two' => 'Dostępne kopie zapasowe', 69 | 'backup_restore_text' => 'Tutaj możesz przywrócić plik .env z kopii zapasowej.', 70 | 'backup_restore_warning' => 'Podczas przywracania aktualny plik .env zostanie nadpisany! Upewnij się że wykonałeś kopię zapasową!', 71 | 'backup_no_backups' => 'Brak kopii zapasowych.', 72 | 'backup_table_nr' => 'Nr.', 73 | 'backup_table_date' => 'Data', 74 | 'backup_table_options' => 'Opcje', 75 | 'backup_table_options_show' => 'Pokaż zawartość kopii', 76 | 'backup_table_options_restore' => 'Przywróć tę wersje', 77 | 'backup_table_options_download' => 'Pobierz tę wersje', 78 | 'backup_table_options_delete' => 'Usuń', 79 | 'backup_modal_title' => 'Zawartość kopii', 80 | 'backup_modal_key' => 'Klucz', 81 | 'backup_modal_value' => 'Wartość', 82 | 'backup_modal_close' => 'Zamknij', 83 | 'backup_modal_restore' => 'Przywróć', 84 | 'backup_modal_delete' => 'Usuń', 85 | 86 | /* 87 | |-------------------------------------------------------------------------- 88 | | View upload 89 | |-------------------------------------------------------------------------- 90 | */ 91 | 'upload_title' => 'Prześlij plik .env na serwer', 92 | 'upload_text' => 'Tutaj możesz przesłać swoją lokalną kopie na serwer', 93 | 'upload_warning'=> 'Uwaga: Ta operacja nadpisze aktualny plik .env. Upewnij się że przed przesłaniem pliku wykonałeś kopie.', 94 | 'upload_label' => 'Wybierz plik', 95 | 'upload_button' => 'Wyślij', 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Messages from View 100 | |-------------------------------------------------------------------------- 101 | */ 102 | 'new_entry_added' => 'Nowa para klucz-wartość została dodana do pliku .env', 103 | 'entry_edited' => 'Para klucz-wartość została zapisana!', 104 | 'entry_deleted' => 'Para klucz-wartość została usunięta!', 105 | 'delete_entry' => 'Usuń rekord', 106 | 'backup_created' => 'Kopia zapasowa wykonana pomyślnie!', 107 | 'backup_restored' => 'Przywracanie kopi zakończyło się pomyślnie!', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Messages from Controller 112 | |-------------------------------------------------------------------------- 113 | */ 114 | 'controller_backup_deleted' => 'Kopia zapasowa została usunięta!', 115 | 'controller_backup_created' => 'Kopia zapasowa wykonana pomyślnie!' 116 | ]; 117 | -------------------------------------------------------------------------------- /resources/lang/ru/class.php: -------------------------------------------------------------------------------- 1 | 'Запрошенное значение не существует!', 13 | 'autobackup_wrong_value' => 'Эта функция может принимать только значения true или false!', 14 | 'requested_backup_not_found' => 'Запрашиваемая резервная копия не существует!', 15 | 'no_backups_available' => 'Нет ни одной резервной копии!', 16 | 'backup_not_deletable' => 'Резервная копия не может быть удалена, так как файл не был найден!', 17 | 'array_needed' => 'Функция может принимать только массив!', 18 | 'numeric_array_needed' => 'Функция может принимать только цифровой массив, содержащий только ключи для удаления!' 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/ru/views.php: -------------------------------------------------------------------------------- 1 | 'Обзор', 10 | 'addnew' => 'Добавить новый', 11 | 'backups' => 'Резервные копии', 12 | 'upload' => 'Загрузить', 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Title 17 | |-------------------------------------------------------------------------- 18 | */ 19 | 'title' => '.env редактор', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | View overview 24 | |-------------------------------------------------------------------------- 25 | */ 26 | 'overview_title' => 'Ваш текущий .env файл', 27 | 'overview_text' => 'Здесь вы можете увидеть содержимое вашего текущего .env файла.
Нажимите Прочитать чтобы отобразить содержимое.', 28 | 'overview_button' => 'Прочитать', 29 | 'overview_table_key' => 'Ключ', 30 | 'overview_table_value' => 'Значение', 31 | 'overview_table_options' => 'Опции', 32 | 'overview_table_popover_edit' => 'Редактировать запись', 33 | 'overview_table_popover_delete' => 'Удалить запись', 34 | 'overview_delete_modal_text' => 'Вы действительно хотите удалить эту запись?', 35 | 'overview_delete_modal_yes' => 'Да, удалить запись', 36 | 'overview_delete_modal_no' => 'Нет, выйти', 37 | 'overview_edit_modal_title' => 'Редактировать запись', 38 | 'overview_edit_modal_save' => 'Сохрнить', 39 | 'overview_edit_modal_quit' => 'Отменить', 40 | 'overview_edit_modal_value' => 'Новое значение', 41 | 'overview_edit_modal_key' => 'Ключ', 42 | 43 | /* 44 | |-------------------------------------------------------------------------- 45 | | View add new 46 | |-------------------------------------------------------------------------- 47 | */ 48 | 'addnew_title' => 'Добавить новую пару ключ-значение', 49 | 'addnew_text' => 'Здесь вы можете добавить новую пару ключ-значение для вашего текущего .env файла.
Для безопасности создайте резервную копию до операции во вкладке Резервные копии.', 50 | 'addnew_label_key' => 'Ключ', 51 | 'addnew_label_value'=> 'Значение', 52 | 'addnew_button_add' => 'Добавить', 53 | 54 | /* 55 | |-------------------------------------------------------------------------- 56 | | View backup 57 | |-------------------------------------------------------------------------- 58 | */ 59 | 'backup_title_one' => 'Сохранить текущий .env файл', 60 | 'backup_create' => 'Создать резервную копию', 61 | 'backup_download' => 'Скачать текущий .env', 62 | 'backup_title_two' => 'Доступные резервные копии', 63 | 'backup_restore_text' => 'Здесь вы можете восстановить одну из доступных резервных копий.', 64 | 'backup_restore_warning' => 'Активный .env файл будет перезаписан! Для безопасности создайте резервную копию текущего .env файла!', 65 | 'backup_no_backups' => 'У вас нет ни одной резервной копии.', 66 | 'backup_table_nr' => '№', 67 | 'backup_table_date' => 'Дата', 68 | 'backup_table_options' => 'Опции', 69 | 'backup_table_options_show' => 'Показать содержимое резервной копии', 70 | 'backup_table_options_restore' => 'Восстановить эту версию', 71 | 'backup_table_options_download' => 'Скачать эту версию', 72 | 'backup_table_options_delete' => 'Удалить эту версию', 73 | 'backup_modal_title' => 'Содержимое резервной копии', 74 | 'backup_modal_key' => 'Ключ', 75 | 'backup_modal_value' => 'Значение', 76 | 'backup_modal_close' => 'Закрыть', 77 | 'backup_modal_restore' => 'Восстановить', 78 | 'backup_modal_delete' => 'Удалить', 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | View upload 83 | |-------------------------------------------------------------------------- 84 | */ 85 | 'upload_title' => 'Загрузить резервную копию', 86 | 'upload_text' => 'Здесь вы можете загрузить резервную копию с вашего компьютера.', 87 | 'upload_warning'=> 'Внимание: Активный .env файл будет перезаписан! Для безопасности создайте резервную копию текущего .env файла.', 88 | 'upload_label' => 'Выберите файл', 89 | 'upload_button' => 'Загрузить', 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Messages from View 94 | |-------------------------------------------------------------------------- 95 | */ 96 | 'new_entry_added' => 'Новая пара ключ-значение была успешно добавлена в ваш .env файл!', 97 | 'entry_edited' => 'Пара ключ-значение была успешно отредактирована!', 98 | 'entry_deleted' => 'Пара ключ-значение была успешно удалена!', 99 | 'delete_entry' => 'Удалить запись', 100 | 'backup_created' => 'Новая резервная копия была успешно создана!', 101 | 'backup_restored' => 'Резервная копия была успешно восстановлена!', 102 | 103 | /* 104 | |-------------------------------------------------------------------------- 105 | | Messages from Controller 106 | |-------------------------------------------------------------------------- 107 | */ 108 | 'controller_backup_deleted' => 'Резервная копия была успешно удалена!', 109 | 'controller_backup_created' => 'Резервная копия была успешно создана!' 110 | ]; 111 | -------------------------------------------------------------------------------- /resources/lang/vi/class.php: -------------------------------------------------------------------------------- 1 | 'Giá trị bạn yêu cầu không tồn tại!', 19 | 'autobackup_wrong_value' => 'Chỉ đúng hoặc sai được chấp nhận cho chức năng này!', 20 | 'requested_backup_not_found' => 'Bản sao lưu bạn yêu cầu không tồn tại!', 21 | 'no_backups_available' => 'Không có bản sao lưu có sẵn!', 22 | 'backup_not_deletable' => 'Không thể xóa sao lưu vì không tìm thấy tệp!', 23 | 'array_needed' => 'Chức năng chỉ chấp nhận một mảng!', 24 | 'numeric_array_needed' => 'Hàm chỉ chấp nhận một mảng số chỉ chứa các khóa có thể xóa!', 25 | ]; 26 | -------------------------------------------------------------------------------- /resources/lang/vi/views.php: -------------------------------------------------------------------------------- 1 | 'Tổng quan', 9 | 'addnew' => 'Thêm mới', 10 | 'backups' => 'Sao lưu', 11 | 'upload' => 'Phục hồi', 12 | 13 | /* 14 | |-------------------------------------------------------------------------- 15 | | Title 16 | |-------------------------------------------------------------------------- 17 | */ 18 | 'title' => 'Trình chỉnh sửa file .env', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | View overview 23 | |-------------------------------------------------------------------------- 24 | */ 25 | 'overview_title' => '.env hiện tại', 26 | 'overview_text' => 'Tại đây bạn có thể thấy nội dung của file .env hiện tại của bạn
Click load để xem.', 27 | 'overview_button' => 'Load', 28 | 'overview_table_key' => 'Khóa', 29 | 'overview_table_value' => 'Giá trị', 30 | 'overview_table_options' => 'Tùy chọn', 31 | 'overview_table_popover_edit' => 'Sửa entry', 32 | 'overview_table_popover_delete' => 'Xóa entry', 33 | 'overview_delete_modal_text' => 'Bạn có chắc chắn xóa chứ?', 34 | 'overview_delete_modal_yes' => 'Yes, xóa nó đi', 35 | 'overview_delete_modal_no' => 'No, đây là sai lầm :D', 36 | 'overview_edit_modal_title' => 'Sửa entry', 37 | 'overview_edit_modal_save' => 'Lưu', 38 | 'overview_edit_modal_quit' => 'Hủy bỏ', 39 | 'overview_edit_modal_value' => 'Giá trị mới', 40 | 'overview_edit_modal_key' => 'Khóa', 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | View add new 45 | |-------------------------------------------------------------------------- 46 | */ 47 | 'addnew_title' => 'Thêm một cặp khóa-giá trị mới', 48 | 'addnew_text' => 'Here you can add a new key-value-pair to your current .env-file.
To be sure, create a backup before under the backup-tab.', 49 | 'addnew_label_key' => 'Khóa', 50 | 'addnew_label_value' => 'Giá trị', 51 | 'addnew_button_add' => 'Thêm', 52 | 53 | /* 54 | |-------------------------------------------------------------------------- 55 | | View backup 56 | |-------------------------------------------------------------------------- 57 | */ 58 | 'backup_title_one' => 'Sao lưu file .env hiện tại', 59 | 'backup_create' => 'Tạo sao lưu', 60 | 'backup_download' => 'Tải xuống bản .env hiện tại', 61 | 'backup_title_two' => 'Sao lưu có sẵn của bạn', 62 | 'backup_restore_text' => 'Tại đây bạn có thể khôi phục một trong những bản sao lưu có sẵn của bạn.', 63 | 'backup_restore_warning' => 'This overwrites your active .env! Be sure to backup your currently active .env-file!', 64 | 'backup_no_backups' => 'Bạn không có bản sao lưu có sẵn nào.', 65 | 'backup_table_nr' => 'Nr.', 66 | 'backup_table_date' => 'Date', 67 | 'backup_table_options' => 'Options', 68 | 'backup_table_options_show' => 'Xem nội dung bản sao lưu', 69 | 'backup_table_options_restore' => 'Phục hồi phiên bản này', 70 | 'backup_table_options_download' => 'Tải xuống', 71 | 'backup_table_options_delete' => 'Xóa', 72 | 'backup_modal_title' => 'Nội dung bản sao lưu', 73 | 'backup_modal_key' => 'Khóa', 74 | 'backup_modal_value' => 'Giá trị', 75 | 'backup_modal_close' => 'Đóng', 76 | 'backup_modal_restore' => 'Sao lưu', 77 | 'backup_modal_delete' => 'Xóa', 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | View upload 82 | |-------------------------------------------------------------------------- 83 | */ 84 | 'upload_title' => 'Tải file đã sao lưu lên', 85 | 'upload_text' => 'Tại đây bạn có thể tải lên bản sao lưu từ máy tính của mình.', 86 | 'upload_warning' => 'Cảnh báo: Điều này sẽ ghi đè tệp .env hiện đang hoạt động của bạn. Hãy chắc chắn rằng bạn tạo một bản sao lưu trước khi tải lên.', 87 | 'upload_label' => 'Chọn tệp', 88 | 'upload_button' => 'Tải lên', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Messages from View 93 | |-------------------------------------------------------------------------- 94 | */ 95 | 'new_entry_added' => 'New key-value-pair was successfully added to your .env!', 96 | 'entry_edited' => 'Key-value-pair was edited successfully!', 97 | 'entry_deleted' => 'Key-value-pair was deleted successfully!', 98 | 'delete_entry' => 'Delete an entry', 99 | 'backup_created' => 'New backup was created successfully!', 100 | 'backup_restored' => 'Backup was restored successfully!', 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Messages from Controller 105 | |-------------------------------------------------------------------------- 106 | */ 107 | 'controller_backup_deleted' => 'Sao lưu đã bị xóa thành công!', 108 | 'controller_backup_created' => 'Sao lưu đã được tạo thành công!', 109 | ]; 110 | -------------------------------------------------------------------------------- /resources/views/master.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Dotenv-Editor 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | @yield('content') 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/views/overview-adminlte.blade.php: -------------------------------------------------------------------------------- 1 | @extends(config('dotenveditor.template', 'dotenv-editor::master')) 2 | 3 | @section('content') 4 |
5 |
6 |

{{ __('dotenv-editor::views.title') }}

7 |
8 |
9 |
10 |

{{ __('dotenv-editor::views.title') }}

11 |
12 |
13 | 18 |
19 |
20 |
21 |
22 |
23 | {{-- Error-Container --}} 24 |
25 | 31 | {{-- Errors from POST-Requests --}} 32 | @if(session('dotenv')) 33 | 39 | @endif 40 |
41 | {{-- Overview --}} 42 |
43 |
44 |
45 |

{{ __('dotenv-editor::views.overview_title') }}

46 |
47 |
48 |

{!! __('dotenv-editor::views.overview_text') !!}

49 |

50 | 51 | {{ __('dotenv-editor::views.overview_button') }} 52 | 53 |

54 |
55 |
56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 68 | 76 | 77 |
{{ __('dotenv-editor::views.overview_table_key') }}{{ __('dotenv-editor::views.overview_table_value') }}{{ __('dotenv-editor::views.overview_table_options') }}
@{{ entry.key }} 65 | 66 | @{{ entry.value | hide(entry.hide) }} 67 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
78 |
79 |
80 | {{-- Modal delete --}} 81 | 105 | {{-- Modal edit --}} 106 | 131 |
132 | {{-- Add new --}} 133 |
134 |
135 |
136 |

{!! __('dotenv-editor::views.addnew_title') !!}

137 |
138 |
139 |

140 | {!! __('dotenv-editor::views.addnew_text') !!} 141 |

142 | 143 |
144 |
145 | 146 | 147 |
148 |
149 | 150 | 151 |
152 | 155 |
156 |
157 |
158 |
159 | {{-- Backups --}} 160 |
161 | {{-- Create Backup --}} 162 |
163 |
164 |

{!! __('dotenv-editor::views.backup_title_one') !!}

165 |
166 | 174 |
175 | 176 | {{-- List of available Backups --}} 177 |
178 |
179 |

{!! __('dotenv-editor::views.backup_title_two') !!}

180 |
181 |
182 |

183 | {!! __('dotenv-editor::views.backup_restore_text') !!} 184 |

185 |

186 | {!! __('dotenv-editor::views.backup_restore_warning') !!} 187 |

188 | @if(!$backups) 189 |

190 | {!! __('dotenv-editor::views.backup_no_backups') !!} 191 |

192 | @endif 193 |
194 | @if($backups) 195 |
196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | @foreach($backups as $backup) 204 | 205 | 206 | 207 | 221 | 222 | @endforeach 223 |
{!! __('dotenv-editor::views.backup_table_nr') !!}{!! __('dotenv-editor::views.backup_table_date') !!}{!! __('dotenv-editor::views.backup_table_options') !!}
{{ $c++ }}{{ $backup['formatted'] }} 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
224 |
225 | @endif 226 |
227 | 228 | @if($backups) 229 | {{-- Details Modal --}} 230 | 263 | @endif 264 |
265 | {{-- Upload --}} 266 |
267 |
268 |
269 |

{!! __('dotenv-editor::views.upload_title') !!}

270 |
271 |
272 |

273 | {!! __('dotenv-editor::views.upload_text') !!}
274 | 275 | {!! __('dotenv-editor::views.upload_warning') !!} 276 | 277 |

278 |
279 |
280 | 281 | 282 |
283 | 286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 | @endsection 295 | 296 | @push('js') 297 | 492 | @endpush 493 | -------------------------------------------------------------------------------- /resources/views/overview.blade.php: -------------------------------------------------------------------------------- 1 | @extends(config('dotenveditor.template', 'dotenv-editor::master')) 2 | 3 | {{-- 4 | Feel free to extend your custom wrapping view. 5 | All needed files are included within this file, so nothing could break if you extend your own master view. 6 | --}} 7 | 8 | @section('content') 9 |
10 | 11 |
12 |

{{ trans('dotenv-editor::views.title') }}

13 | 14 |
15 |
16 | 21 |
22 |
23 | 24 |

25 | 26 |
27 | 28 |
29 | 30 | {{-- Error-Container --}} 31 |
32 | {{-- VueJS-Errors --}} 33 | 39 | {{-- Errors from POST-Requests --}} 40 | @if(session('dotenv')) 41 | 47 | @endif 48 |
49 | 50 | {{-- Overview --}} 51 |
52 | 53 |
54 |
55 |

56 | {{ trans('dotenv-editor::views.overview_title') }} 57 |

58 |
59 |
60 |

61 | {!! trans('dotenv-editor::views.overview_text') !!} 62 |

63 |

64 | 65 | {{ trans('dotenv-editor::views.overview_button') }} 66 | 67 |

68 |
69 |
70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 89 | 90 |
{{ trans('dotenv-editor::views.overview_table_key') }}{{ trans('dotenv-editor::views.overview_table_value') }}{{ trans('dotenv-editor::views.overview_table_options') }}
@{{ entry.key }}@{{ entry.value }} 80 | 82 | 83 | 84 | 86 | 87 | 88 |
91 |
92 |
93 | 94 | {{-- Modal delete --}} 95 | 119 | 120 | {{-- Modal edit --}} 121 | 146 | 147 |
148 | 149 | {{-- Add new --}} 150 |
151 |
152 |
153 |

{!! trans('dotenv-editor::views.addnew_title') !!}

154 |
155 |
156 |

157 | {!! trans('dotenv-editor::views.addnew_text') !!} 158 |

159 | 160 |
161 |
162 | 163 | 164 |
165 |
166 | 167 | 168 |
169 | 172 |
173 |
174 |
175 |
176 | 177 | {{-- Backups --}} 178 |
179 | {{-- Create Backup --}} 180 |
181 |
182 |

{!! trans('dotenv-editor::views.backup_title_one') !!}

183 |
184 | 192 |
193 | 194 | {{-- List of available Backups --}} 195 |
196 |
197 |

{!! trans('dotenv-editor::views.backup_title_two') !!}

198 |
199 |
200 |

201 | {!! trans('dotenv-editor::views.backup_restore_text') !!} 202 |

203 |

204 | {!! trans('dotenv-editor::views.backup_restore_warning') !!} 205 |

206 | @if(!$backups) 207 |

208 | {!! trans('dotenv-editor::views.backup_no_backups') !!} 209 |

210 | @endif 211 |
212 | @if($backups) 213 |
214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | @foreach($backups as $backup) 222 | 223 | 224 | 225 | 226 | 242 | 243 | @endforeach 244 |
{!! trans('dotenv-editor::views.backup_table_nr') !!}{!! trans('dotenv-editor::views.backup_table_date') !!}{!! trans('dotenv-editor::views.backup_table_options') !!}
{{ $c++ }}{{ $backup['formatted'] }} 227 | 228 | 229 | 230 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 |
245 |
246 | @endif 247 |
248 | 249 | @if($backups) 250 | {{-- Details Modal --}} 251 | 287 | @endif 288 | 289 |
290 | 291 | {{-- Upload --}} 292 |
293 |
294 |
295 |

{!! trans('dotenv-editor::views.upload_title') !!}

296 |
297 |
298 |

299 | {!! trans('dotenv-editor::views.upload_text') !!}
300 | 301 | {!! trans('dotenv-editor::views.upload_warning') !!} 302 | 303 |

304 |
305 |
306 | 307 | 308 |
309 | 312 |
313 |
314 |
315 |
316 |
317 | 318 |
319 |
320 | 321 |
322 | 323 | 324 | 490 | 491 | 492 | 493 | 503 | 504 | @endsection 505 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('index'); 13 | Route::post('/add', 'EnvController@add')->name('add'); 14 | Route::post('/update', 'EnvController@update')->name('update'); 15 | Route::get('/createbackup', 'EnvController@createBackup')->name('createbackup'); 16 | Route::get('/deletebackup/{timestamp}', 'EnvController@deleteBackup')->name('deletebackup'); 17 | Route::get('/restore/{backuptimestamp}', 'EnvController@restore')->name('restore'); 18 | Route::post('/delete', 'EnvController@delete')->name('delete'); 19 | Route::get('/download/{filename?}', 'EnvController@download')->name('download'); 20 | Route::post('/upload', 'EnvController@upload')->name('upload'); 21 | Route::get('/getdetails/{timestamp?}', 'EnvController@getDetails')->name('getdetails'); 22 | } 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /src/DotenvEditor.php: -------------------------------------------------------------------------------- 1 | env = $env; 43 | 44 | if (!is_dir($backupPath)) { 45 | mkdir($backupPath, $filePermissions, true); 46 | } 47 | $this->backupPath = $backupPath; 48 | } 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | Getter & setter 53 | |-------------------------------------------------------------------------- 54 | | 55 | | 56 | | 57 | */ 58 | /** 59 | * Returns the current backup-path 60 | * 61 | * @return mixed 62 | */ 63 | public function getBackupPath() 64 | { 65 | return $this->backupPath; 66 | } 67 | 68 | /** 69 | * Set a new backup-path. 70 | * The new directory will be created if it doesn't exist 71 | * 72 | * @param string $path [backup path] 73 | * 74 | * @return bool 75 | */ 76 | public function setBackupPath($path) 77 | { 78 | if (!is_dir($path)) { 79 | try { 80 | mkdir($path, 0777, true); 81 | } catch (InvalidPathException $e) { 82 | echo htmlspecialchars($e->getMessage()); 83 | return false; 84 | } 85 | } 86 | $this->backupPath = $path; 87 | return true; 88 | } 89 | 90 | /** 91 | * Checks, if a given key exists in your .env-file. 92 | * Returns false or true 93 | * 94 | * @param string $key [key] 95 | * 96 | * @return bool 97 | */ 98 | public function keyExists($key) 99 | { 100 | $env = $this->getContent(); 101 | return (array_key_exists($key, $env)); 102 | } 103 | 104 | /** 105 | * Returns the value matching to a given key. 106 | * Returns false, if key does not exist. 107 | * 108 | * @param string $key [key to get value] 109 | * 110 | * @return mixed 111 | * @throws DotEnvException 112 | */ 113 | public function getValue($key) 114 | { 115 | if ($this->keyExists($key)) { 116 | return env($key); 117 | } else { 118 | throw new DotEnvException(trans('dotenv-editor::class.requested_value_not_available'), 0); 119 | } 120 | } 121 | 122 | /** 123 | * Activate or deactivate the AutoBackup-Functionality 124 | * 125 | * @param boolean $onOff [set auto backup on or of] 126 | * 127 | * @return void 128 | * @throws DotEnvException 129 | */ 130 | public function setAutoBackup($onOff) 131 | { 132 | if (is_bool($onOff)) { 133 | $this->autoBackup = $onOff; 134 | } else { 135 | throw new DotEnvException(trans('dotenv-editor::class.autobackup_wrong_value'), 0); 136 | } 137 | } 138 | 139 | /** 140 | * Checks, if Autobackup is enabled 141 | * 142 | * @return bool 143 | */ 144 | public function autoBackupEnabled() 145 | { 146 | return $this->autoBackup; 147 | } 148 | /* 149 | |-------------------------------------------------------------------------- 150 | | Working with backups 151 | |-------------------------------------------------------------------------- 152 | | 153 | | createBackup() 154 | | getLatestBackup() 155 | | restoreBackup($timestamp = NULL) 156 | | getBackupVersions($formated = 1) 157 | | getBackupFile($timestamp) 158 | | 159 | */ 160 | /** 161 | * Used to create a backup of the current .env. 162 | * Will be assigned with the current timestamp. 163 | * 164 | * @return bool 165 | */ 166 | public function createBackup() 167 | { 168 | return copy( 169 | $this->env, 170 | $this->backupPath . time() . "_env" 171 | ); 172 | } 173 | 174 | /** 175 | * Returns the timestamp of the latest version. 176 | * 177 | * @return int|mixed 178 | */ 179 | protected function getLatestBackup() 180 | { 181 | $backups = $this->getBackupVersions(); 182 | $latestBackup = 0; 183 | foreach ($backups as $backup) { 184 | if ($backup > $latestBackup) { 185 | $latestBackup = $backup; 186 | } 187 | } 188 | return $latestBackup; 189 | } 190 | 191 | /** 192 | * Restores the latest backup or a backup from a given timestamp. 193 | * Restores the latest version when no timestamp is given. 194 | * 195 | * @param null $timestamp timestamp 196 | * 197 | * @return string 198 | */ 199 | public function restoreBackup($timestamp = null) 200 | { 201 | $file = null; 202 | if ($timestamp !== null) { 203 | if ($this->getFile($timestamp)) { 204 | $file = $this->getFile($timestamp); 205 | } 206 | } else { 207 | $file = $this->getFile($this->getLatestBackup()['unformatted']); 208 | } 209 | 210 | return copy($file, $this->env); 211 | } 212 | 213 | /** 214 | * Returns the file for the given backup-timestamp 215 | * 216 | * @param null $timestamp timestamp 217 | * 218 | * @return string 219 | * @throws DotEnvException 220 | */ 221 | protected function getFile($timestamp) 222 | { 223 | $file = $this->getBackupPath() . $timestamp . "_env"; 224 | 225 | if (file_exists($file)) { 226 | return $file; 227 | } else { 228 | throw new DotEnvException(trans('dotenv-editor::class.requested_backup_not_found'), 0); 229 | } 230 | 231 | } 232 | 233 | /** 234 | * Returns an array with all available backups. 235 | * Array contains the formatted and unformatted version of each backup. 236 | * Throws exception, if no backups were found. 237 | * 238 | * @return array 239 | * @throws DotEnvException 240 | */ 241 | public function getBackupVersions() 242 | { 243 | $versions = array_diff(scandir($this->backupPath), array('..', '.')); 244 | 245 | if (count($versions) > 0) { 246 | $output = array(); 247 | $count = 0; 248 | foreach ($versions as $version) { 249 | $part = explode("_", $version); 250 | $output[$count]['formatted'] = date("Y-m-d H:i:s", (int) $part[0]); 251 | $output[$count]['unformatted'] = $part[0]; 252 | $count++; 253 | } 254 | return $output; 255 | } 256 | throw new DotEnvException(trans('dotenv-editor::class.no_backups_available'), 0); 257 | } 258 | 259 | /** 260 | * Returns filename and path for the given timestamp 261 | * 262 | * @param null $timestamp timestamp 263 | * 264 | * @return string 265 | * @throws DotEnvException 266 | */ 267 | public function getBackupFile($timestamp) 268 | { 269 | if (file_exists($this->getBackupPath() . $timestamp . "_env")) { 270 | return $this->backupPath . $timestamp . "_env"; 271 | } 272 | throw new DotEnvException(trans('dotenv-editor::class.requested_backup_not_found'), 0); 273 | } 274 | 275 | /** 276 | * Delete the given backup-file 277 | * 278 | * @param null $timestamp timestamp 279 | * 280 | * @return void 281 | * @throws DotEnvException 282 | */ 283 | public function deleteBackup($timestamp) 284 | { 285 | $file = $this->getBackupPath() . $timestamp . "_env"; 286 | if (file_exists($file)) { 287 | unlink($file); 288 | } else { 289 | throw new DotEnvException(trans('dotenv-editor::class.backup_not_deletable'), 0); 290 | } 291 | } 292 | 293 | /* 294 | |-------------------------------------------------------------------------- 295 | | Get the content 296 | |-------------------------------------------------------------------------- 297 | | 298 | | getContent($backup = NULL) 299 | | 300 | */ 301 | 302 | /** 303 | * Returns the content of a given backup file 304 | * or the content of the current env file. 305 | * 306 | * @param null $timestamp timestamp 307 | * 308 | * @return array 309 | */ 310 | public function getContent($timestamp = null) 311 | { 312 | if ($timestamp === null) { 313 | return $this->envToArray($this->env); 314 | } else { 315 | return $this->envToArray($this->getBackupFile($timestamp)); 316 | } 317 | } 318 | 319 | /** 320 | * Writes the content of a env file to an array. 321 | * 322 | * @param file $file file 323 | * 324 | * @return array 325 | */ 326 | protected function envToArray($file) 327 | { 328 | $string = file_get_contents($file); 329 | $string = preg_split('/\n+/', $string); 330 | $returnArray = array(); 331 | 332 | foreach ($string as $one) { 333 | if (preg_match('/^(#\s)/', $one) === 1 || preg_match('/^([\\n\\r]+)/', $one)) { 334 | continue; 335 | } 336 | $entry = explode("=", $one, 2); 337 | $returnArray[$entry[0]] = isset($entry[1]) ? $entry[1] : null; 338 | } 339 | 340 | return array_filter( 341 | $returnArray, 342 | function ($key) { 343 | return !empty($key); 344 | }, 345 | ARRAY_FILTER_USE_KEY 346 | ); 347 | } 348 | 349 | /** 350 | * Returns the given .env as JSON array containing all entries as object 351 | * with key and value 352 | * 353 | * @param null $timestamp timestamp 354 | * 355 | * @return string 356 | */ 357 | public function getAsJson($timestamp = null) 358 | { 359 | return $this->envToJson($this->getContent($timestamp)); 360 | } 361 | 362 | /** 363 | * Converts the given .env-array to JSON 364 | * 365 | * @param array $file file 366 | * 367 | * @return string 368 | */ 369 | private function envToJson($file = []) 370 | { 371 | $array = []; 372 | $c = 0; 373 | foreach ($file as $key => $value) { 374 | $array[$c] = new \stdClass(); 375 | $array[$c]->key = $key; 376 | $array[$c]->value = $value; 377 | $c++; 378 | } 379 | return json_encode($array); 380 | } 381 | 382 | /* 383 | |-------------------------------------------------------------------------- 384 | | Editing the env content 385 | |-------------------------------------------------------------------------- 386 | | 387 | | changeEnv($data = array()) 388 | | 389 | */ 390 | 391 | /** 392 | * Saves the given data to the .env-file 393 | * 394 | * @param array $array array 395 | * 396 | * @return bool 397 | */ 398 | protected function save($array) 399 | { 400 | if (is_array($array)) { 401 | $newArray = array(); 402 | $c = 0; 403 | foreach ($array as $key => $value) { 404 | if (preg_match('/\s/', $value) > 0 && (strpos($value, '"') > 0 && strpos($value, '"', -0) > 0)) { 405 | $value = '"' . $value . '"'; 406 | } 407 | 408 | $newArray[$c] = $key . "=" . $value; 409 | $c++; 410 | } 411 | 412 | $newArray = implode("\n", $newArray); 413 | 414 | file_put_contents($this->env, $newArray); 415 | 416 | return true; 417 | } 418 | return false; 419 | } 420 | 421 | /** 422 | * Change the given values of the current env file. 423 | * If the given key(s) is/are not found, nothing happens. 424 | * 425 | * @param array $data data 426 | * 427 | * @return bool 428 | * @throws DotEnvException 429 | */ 430 | public function changeEnv($data = array()) 431 | { 432 | if (count($data) > 0) { 433 | if ($this->autoBackupEnabled()) { 434 | $this->createBackup(); 435 | } 436 | 437 | $env = $this->getContent(); 438 | 439 | foreach ($data as $dataKey => $dataValue) { 440 | 441 | foreach (array_keys($env) as $envKey) { 442 | if ($dataKey === $envKey) { 443 | $env[$envKey] = $dataValue; 444 | } 445 | } 446 | 447 | } 448 | return $this->save($env); 449 | } 450 | throw new DotEnvException(trans('dotenv-editor::class.array_needed'), 0); 451 | } 452 | 453 | /** 454 | * Add data to the current env file. 455 | * Data will be placed at the end. 456 | * 457 | * @param array $data data 458 | * 459 | * @return bool 460 | * @throws DotEnvException 461 | */ 462 | public function addData($data = array()) 463 | { 464 | if (count($data) > 0) { 465 | if ($this->autoBackupEnabled()) { 466 | $this->createBackup(); 467 | } 468 | 469 | $env = $this->getContent(); 470 | 471 | // Expand the existing array with the new data 472 | foreach ($data as $key => $value) { 473 | $env[$key] = $this->santize($value); 474 | } 475 | 476 | return $this->save($env); 477 | } 478 | throw new DotEnvException(trans('dotenv-editor::class.array_needed'), 0); 479 | } 480 | 481 | /** 482 | * [santize description] 483 | * 484 | * @param string $value [description] 485 | * 486 | * @return $value santize value 487 | */ 488 | public function santize($value = '') 489 | { 490 | if ($this->isStartOrEndWith($value, '\'')) { 491 | $value = $this->setStartAndEndWith($value, '\''); 492 | } 493 | if ($this->isStartOrEndWith($value, '"')) { 494 | $value = $this->setStartAndEndWith($value, '"'); 495 | } 496 | if (preg_match('/\s/', $value)) { 497 | $value = $this->setStartAndEndWith($value, '"'); 498 | } 499 | return $value; 500 | } 501 | 502 | /** 503 | * [isStartOrEndWith description] 504 | * 505 | * @param string $value value 506 | * @param string $string check string 507 | * 508 | * @return boolean 509 | */ 510 | public function isStartOrEndWith($value, $string = '') 511 | { 512 | return Str::startsWith($value, $string) || Str::endsWith($value, $string); 513 | } 514 | 515 | /** 516 | * [setStartAndEndWith description] 517 | * 518 | * @param string $value value 519 | * @param string $string check string 520 | * 521 | * @return string value 522 | */ 523 | public function setStartAndEndWith($value, $string = '"') 524 | { 525 | $value = Str::start($value, $string); 526 | $value = Str::finish($value, $string); 527 | return $value; 528 | } 529 | 530 | /** 531 | * Delete one or more entries from the env file. 532 | * 533 | * @param array $data data 534 | * 535 | * @return bool 536 | * @throws DotEnvException 537 | */ 538 | public function deleteData($data = array()) 539 | { 540 | foreach ($data as $key => $value) { 541 | if (!is_numeric($key)) { 542 | throw new DotEnvException("dotenv-editor::class.numeric_array_needed", 0); 543 | } 544 | } 545 | 546 | if ($this->autoBackupEnabled()) { 547 | $this->createBackup(); 548 | } 549 | $env = $this->getContent(); 550 | 551 | foreach ($data as $delete) { 552 | foreach ($env as $key => $value) { 553 | if ($delete === $key) { 554 | unset($env[$key]); 555 | } 556 | } 557 | } 558 | return $this->save($env); 559 | } 560 | } 561 | -------------------------------------------------------------------------------- /src/DotenvEditorFacade.php: -------------------------------------------------------------------------------- 1 | publishes( 23 | [ 24 | __DIR__ . '/../resources/views' => resource_path('views/vendor/dotenv-editor'), 25 | ], 26 | 'views' 27 | ); 28 | 29 | $this->publishes( 30 | [ 31 | __DIR__ . '/../config/dotenveditor.php' => config_path('dotenveditor.php'), 32 | ], 33 | 'config' 34 | ); 35 | 36 | $this->loadRoutesFrom(__DIR__ . '/../routes/web.php'); 37 | $this->loadViewsFrom(__DIR__ . '/../resources/views', 'dotenv-editor'); 38 | $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'dotenv-editor'); 39 | } 40 | 41 | /** 42 | * Provider register 43 | * 44 | * @return null 45 | */ 46 | public function register() 47 | { 48 | $this->app->bind( 49 | 'brotzka-dotenveditor', 50 | function () { 51 | return new DotenvEditor(); 52 | } 53 | ); 54 | 55 | $this->mergeConfigFrom(__DIR__ . '/../config/dotenveditor.php', 'dotenveditor'); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Exceptions/DotEnvException.php: -------------------------------------------------------------------------------- 1 | code}]: {$this->message}\n"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Http/Controllers/EnvController.php: -------------------------------------------------------------------------------- 1 | env = $env; 27 | } 28 | 29 | /** 30 | * Shows the overview, where you can visually edit your .env-file. 31 | * 32 | * @param Request $request request 33 | * 34 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View 35 | */ 36 | public function overview(Request $request) 37 | { 38 | $data['values'] = $this->env->getContent(); 39 | //$data['json'] = json_encode($data['values']); 40 | try { 41 | $data['backups'] = $this->env->getBackupVersions(); 42 | } catch (DotEnvException $e) { 43 | $data['backups'] = false; 44 | } 45 | 46 | $data['url'] = $request->path(); 47 | return view(config('dotenveditor.overview'), $data); 48 | } 49 | 50 | /** 51 | * Adds a new entry to your .env-file. 52 | * 53 | * @param Request $request request 54 | * 55 | * @return none 56 | */ 57 | public function add(Request $request) 58 | { 59 | $this->env->addData( 60 | [ 61 | $request->key => $request->value, 62 | ] 63 | ); 64 | return response()->json([]); 65 | } 66 | 67 | /** 68 | * Updates the given entry from your .env. 69 | * 70 | * @param Request $request request 71 | * 72 | * @return void 73 | */ 74 | public function update(Request $request) 75 | { 76 | $this->env->changeEnv( 77 | [ 78 | $request->key => $request->value, 79 | ] 80 | ); 81 | return response()->json([]); 82 | } 83 | 84 | /** 85 | * Returns the content as JSON 86 | * 87 | * @param null $timestamp timespamp 88 | * 89 | * @return string 90 | */ 91 | public function getDetails($timestamp = null) 92 | { 93 | return $this->env->getAsJson($timestamp); 94 | } 95 | 96 | /** 97 | * Creates a backup of the current .env. 98 | * 99 | * @return \Illuminate\Http\RedirectResponse 100 | */ 101 | public function createBackup() 102 | { 103 | $this->env->createBackup(); 104 | return back()->with('dotenv', trans('dotenv-editor::views.controller_backup_created')); 105 | } 106 | 107 | /** 108 | * Delete Backup 109 | * 110 | * @param string $timestamp timestamp 111 | * 112 | * @return \Illuminate\Http\RedirectResponse 113 | */ 114 | public function deleteBackup($timestamp) 115 | { 116 | $this->env->deleteBackup($timestamp); 117 | return back()->with('dotenv', trans('dotenv-editor::views.controller_backup_deleted')); 118 | } 119 | 120 | /** 121 | * Restore a backup 122 | * 123 | * @param void $backuptimestamp backuptimestamp 124 | * 125 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector 126 | */ 127 | public function restore($backuptimestamp) 128 | { 129 | $this->env->restoreBackup($backuptimestamp); 130 | return redirect(config('dotenveditor.route.prefix')); 131 | } 132 | 133 | /** 134 | * Deletes the given entry from your .env-file 135 | * 136 | * @param Request $request request 137 | * 138 | * @return void 139 | */ 140 | public function delete(Request $request) 141 | { 142 | $this->env->deleteData([$request->key]); 143 | } 144 | 145 | /** 146 | * Lets you download the choosen backup-file. 147 | * 148 | * @param bool $filename filename 149 | * 150 | * @return \Symfony\Component\HttpFoundation\BinaryFileResponse 151 | */ 152 | public function download($filename = false) 153 | { 154 | if ($filename) { 155 | $file = $this->env->getBackupPath() . $filename . '_env'; 156 | return response()->download($file, $filename . '.env'); 157 | } 158 | return response()->download(base_path('.env'), '.env'); 159 | } 160 | 161 | /** 162 | * Upload a .env-file and replace the current one 163 | * 164 | * @param Request $request request 165 | * 166 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector 167 | */ 168 | public function upload(Request $request) 169 | { 170 | $file = $request->file('backup'); 171 | $file->move(base_path(), '.env'); 172 | return redirect(config('dotenveditor.route.prefix')); 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /src/Lang/tr/class.php: -------------------------------------------------------------------------------- 1 | 'İstediğiniz değer mevcut değil!', 19 | 'autobackup_wrong_value' => 'Bu işlev için yalnızca doğru veya yanlış kabul edilir!', 20 | 'requested_backup_not_found' => 'İstediğiniz yedek mevcut değil!', 21 | 'no_backups_available' => 'Kullanılabilir yedek yok!', 22 | 'backup_not_deletable' => 'Dosya bulunamadığı için yedek silinemedi!', 23 | 'array_needed' => 'İşlev sadece bir diziyi kabul eder!', 24 | 'numeric_array_needed' => 'Fonksiyon sadece sadece silinebilir keyleri içeren bir sayısal diziyi kabul eder!', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/Lang/tr/views.php: -------------------------------------------------------------------------------- 1 | 'Genel', 16 | 'addnew' => 'Yeni Ekle', 17 | 'backups' => 'Yedekler', 18 | 'upload' => 'Yükle', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Title 23 | |-------------------------------------------------------------------------- 24 | */ 25 | 'title' => '.env-Editor', 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | View overview 30 | |-------------------------------------------------------------------------- 31 | */ 32 | 'overview_title' => 'Geçerli .env dosyanız', 33 | 'overview_text' => 'Burada mevcut aktif .env. İçeriğini görebilirsiniz. İçeriği göstermek için yükle \'yi tıklayın.', 34 | 'overview_button' => 'Yükle', 35 | 'overview_table_key' => 'Anahtar', 36 | 'overview_table_value' => 'Değer', 37 | 'overview_table_options' => 'Seçenekler', 38 | 'overview_table_popover_edit' => 'Kaydı Düzenle', 39 | 'overview_table_popover_delete' => 'Kaydı Sil', 40 | 'overview_delete_modal_text' => 'Bu kaydı gerçekten silmek istiyor musunuz?', 41 | 'overview_delete_modal_yes' => 'Evet, Kaydı Sil', 42 | 'overview_delete_modal_no' => 'Hayır, çık', 43 | 'overview_edit_modal_title' => 'Kaydı Düzenle', 44 | 'overview_edit_modal_save' => 'Kaydet', 45 | 'overview_edit_modal_quit' => 'İptal', 46 | 'overview_edit_modal_value' => 'Yeni Değer', 47 | 'overview_edit_modal_key' => 'Anahtar', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | View add new 52 | |-------------------------------------------------------------------------- 53 | */ 54 | 'addnew_title' => 'Yeni anahtar / değer çiftini ekle', 55 | 'addnew_text' => 'Burada geçerli .env dosyanıza yeni bir anahtar / değer çifti ekleyebilirsiniz. Emin olmak için, yedekleme sekmesinden önce bir yedek oluşturun.', 56 | 'addnew_label_key' => 'Anahtar', 57 | 'addnew_label_value'=> 'Değer', 58 | 'addnew_button_add' => 'Ekle', 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | View backup 63 | |-------------------------------------------------------------------------- 64 | */ 65 | 'backup_title_one' => 'Geçerli .env dosyanızı kaydet', 66 | 'backup_create' => 'Yedek Oluştur', 67 | 'backup_download' => 'Güncel .env indir', 68 | 'backup_title_two' => 'Mevcut yedekleriniz', 69 | 'backup_restore_text' => 'Buradan mevcut yedeklerinizden birini geri yükleyebilirsiniz.', 70 | 'backup_restore_warning' => 'Bu aktif .env\'in üzerine yazıyor! Şu anda aktif .env dosyanızı yedeklediğinizden emin olun!', 71 | 'backup_no_backups' => 'Yedeklemeniz yok.', 72 | 'backup_table_nr' => 'Sıra', 73 | 'backup_table_date' => 'Tarih', 74 | 'backup_table_options' => 'Seçenekler', 75 | 'backup_table_options_show' => 'Yedekleme içeriğini göster', 76 | 'backup_table_options_restore' => 'Bu sürümü geri yükle', 77 | 'backup_table_options_download' => 'Bu sürümü indir', 78 | 'backup_table_options_delete' => 'Bu sürümü sil', 79 | 'backup_modal_title' => 'Yedekleme içeriği', 80 | 'backup_modal_key' => 'Anahtar', 81 | 'backup_modal_value' => 'Değer', 82 | 'backup_modal_close' => 'Kapat', 83 | 'backup_modal_restore' => 'Eski haline getir', 84 | 'backup_modal_delete' => 'Sil', 85 | 86 | /* 87 | |-------------------------------------------------------------------------- 88 | | View upload 89 | |-------------------------------------------------------------------------- 90 | */ 91 | 'upload_title' => 'Yedek yükle', 92 | 'upload_text' => 'Buradan bilgisayarınızdan bir yedek yükleyebilirsiniz.', 93 | 'upload_warning'=> ' Uyarı: Bu, şu anda aktif olan .env dosyanızı geçersiz kılacaktır. Yüklemeden önce bir yedek oluşturduğunuzdan emin olun.', 94 | 'upload_label' => 'Dosya Seç', 95 | 'upload_button' => 'Yükle', 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Messages from View 100 | |-------------------------------------------------------------------------- 101 | */ 102 | 'new_entry_added' => 'Yeni anahtar / değer çifti, .env\'inize başarıyla eklendi!', 103 | 'entry_edited' => 'Anahtar / değer çifti başarıyla düzenlendi!', 104 | 'entry_deleted' => 'Anahtar / değer çifti başarıyla silindi!', 105 | 'delete_entry' => 'Bir kayıt sil', 106 | 'backup_created' => 'Yeni yedekleme başarıyla oluşturuldu!', 107 | 'backup_restored' => 'Yedekleme başarıyla geri yüklendi!', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Messages from Controller 112 | |-------------------------------------------------------------------------- 113 | */ 114 | 'controller_backup_deleted' => 'Yedekleme başarıyla silindi!', 115 | 'controller_backup_created' => 'Yedekleme başarıyla oluşturuldu!', 116 | ]; 117 | --------------------------------------------------------------------------------