├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── UPGRADE.md ├── composer.json ├── mix-manifest.json ├── package-lock.json ├── pint.json ├── resources ├── lang │ ├── ar │ │ └── backup.php │ ├── cs │ │ └── backup.php │ ├── de │ │ └── backup.php │ ├── en │ │ └── backup.php │ ├── es │ │ └── backup.php │ ├── fa │ │ └── backup.php │ ├── fr │ │ └── backup.php │ ├── id │ │ └── backup.php │ ├── it │ │ └── backup.php │ ├── ko │ │ └── backup.php │ ├── nl │ │ └── backup.php │ ├── pt │ │ └── backup.php │ ├── pt_BR │ │ └── backup.php │ ├── pt_PT │ │ └── backup.php │ ├── ru │ │ └── backup.php │ ├── tr │ │ └── backup.php │ ├── vi │ │ └── backup.php │ └── zh_CN │ │ └── backup.php └── views │ ├── .gitkeep │ ├── components │ ├── backup-destination-list-records.blade.php │ └── backup-destination-status-list-records.blade.php │ └── pages │ └── backups.blade.php └── src ├── Components ├── BackupDestinationListRecords.php └── BackupDestinationStatusListRecords.php ├── Enums └── Option.php ├── FilamentSpatieLaravelBackup.php ├── FilamentSpatieLaravelBackupPlugin.php ├── FilamentSpatieLaravelBackupServiceProvider.php ├── Jobs └── CreateBackupJob.php ├── Models ├── BackupDestination.php └── BackupDestinationStatus.php └── Pages └── Backups.php /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `filament-spatie-laravel-backup` will be documented in this file. 4 | 5 | ## v1.4.0 - 2025-05-15 6 | 7 | ### What's Changed 8 | 9 | * Fix for Issue #90 by @RChutchev in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/92 10 | 11 | ### New Contributors 12 | 13 | * @RChutchev made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/92 14 | 15 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.3.1...v1.4.0 16 | 17 | ## v2.3.4 - 2025-01-22 18 | 19 | ### What's Changed 20 | 21 | * Add authorize method by @SanderMuller in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/84 22 | 23 | ### New Contributors 24 | 25 | * @SanderMuller made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/84 26 | 27 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.2.3...v2.2.4 28 | 29 | ## v2.2.3 - 2024-10-20 30 | 31 | ### What's Changed 32 | 33 | * Added Italian translation, fixed delete action color and modal icon by @marcogermani87 in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/82 34 | * Add missing translation option 'backup_delete_success' by @alkoumi in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/81 35 | 36 | ### New Contributors 37 | 38 | * @marcogermani87 made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/82 39 | * @alkoumi made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/81 40 | 41 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.2.2...v2.2.3 42 | 43 | ## v2.2.2 - 2024-08-14 44 | 45 | ### What's Changed 46 | 47 | * Fixed type error when spatie/laravel-backup@v9 is used by @den1n in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/79 48 | 49 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.2.1...v2.2.2 50 | 51 | ## v2.2.1 - 2024-08-13 52 | 53 | ### What's Changed 54 | 55 | * Added spatie/laravel-backup v9 to composer.json by @den1n in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/77 56 | 57 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.2.0...v2.2.1 58 | 59 | ## v2.2.0 - 2024-07-07 60 | 61 | ### What's Changed 62 | 63 | * Added timeout option in modal by @jetwes in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/72 64 | 65 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.1.4...v2.2.0 66 | 67 | ## v2.1.4 - 2024-06-28 68 | 69 | ### What's Changed 70 | 71 | * Add Simplified Chinese translation by @curder in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/63 72 | * Add Farsi translations by @mokhosh in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/62 73 | * Korean translations add by @corean in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/61 74 | * fix wrong class name by @nikcani in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/68 75 | * added german language file by @jetwes in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/71 76 | 77 | ### New Contributors 78 | 79 | * @curder made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/63 80 | * @mokhosh made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/62 81 | * @corean made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/61 82 | * @nikcani made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/68 83 | * @jetwes made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/71 84 | 85 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.1.3...v2.1.4 86 | 87 | ## v2.1.3 - 2023-12-30 88 | 89 | ### What's Changed 90 | 91 | * Renamed folder name to match Filaments i18n structure by @Corvisier in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/59 92 | 93 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.1.2...v2.1.3 94 | 95 | ## v2.1.2 - 2023-12-25 96 | 97 | ### What's Changed 98 | 99 | * European Portuguese by @Corvisier in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/58 100 | 101 | ### New Contributors 102 | 103 | * @Corvisier made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/58 104 | 105 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.1.1...v2.1.2 106 | 107 | ## v2.1.1 - 2023-12-20 108 | 109 | ### What's Changed 110 | 111 | * Add Czech translations by @musilondrej in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/57 112 | * Add Indonesian translation by @lakuapik in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/56 113 | 114 | ### New Contributors 115 | 116 | * @musilondrej made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/57 117 | * @lakuapik made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/56 118 | 119 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.1.0...v2.1.1 120 | 121 | ## v2.0.1 - 2023-08-28 122 | 123 | ### What's Changed 124 | 125 | - Dutch translations by @vanhooff in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/52 126 | - Updated Russian translation. by @den1n in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/53 127 | 128 | ### New Contributors 129 | 130 | - @vanhooff made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/52 131 | 132 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v2.0.0...v2.0.1 133 | 134 | ## v2.0.0 - 2023-08-05 135 | 136 | ### What's Changed 137 | 138 | - Support v3 🎸 by @shuvroroy in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/51 139 | 140 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.3.1...v2.0.0 141 | 142 | ## v1.3.1 - 2023-04-30 143 | 144 | ### What's Changed 145 | 146 | - fix: display status by overriding the function by @vincent-tarrit in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/43 147 | 148 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.3.0...v1.3.1 149 | 150 | ## v1.3.0 - 2023-04-30 151 | 152 | ### What's Changed 153 | 154 | - chore(deps): bump ramsey/composer-install from 1 to 2 by @dependabot in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/36 155 | - chore(deps): bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/40 156 | - chore(deps): bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 by @dependabot in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/41 157 | - feat: add a right to create, download and delete backup by @vincent-tarrit in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/42 158 | 159 | ### New Contributors 160 | 161 | - @vincent-tarrit made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/42 162 | 163 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.2.6...v1.3.0 164 | 165 | ## v1.2.6 - 2022-11-16 166 | 167 | ### What's Changed 168 | 169 | - chore(deps): bump dependabot/fetch-metadata from 1.3.3 to 1.3.4 by @dependabot in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/31 170 | - chore(deps): bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 by @dependabot in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/34 171 | - Added translation to Russian. by @den1n in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/35 172 | 173 | ### New Contributors 174 | 175 | - @den1n made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/35 176 | 177 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.2.5...v1.2.6 178 | 179 | ## v1.2.5 - 2022-08-11 180 | 181 | ### What's Changed 182 | 183 | - tr typo fix word by @necmicolak in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/26 184 | - Vietnamese translations by @datlechin in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/27 185 | - chore(deps): bump actions/checkout from 2 to 3 by @dependabot in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/11 186 | 187 | ### New Contributors 188 | 189 | - @necmicolak made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/26 190 | - @datlechin made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/27 191 | 192 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.2.4...v1.2.5 193 | 194 | ## v1.2.4 - 2022-07-19 195 | 196 | ### What's Changed 197 | 198 | - [FR] Create backup.php by @nicolasbaud in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/25 199 | 200 | ### New Contributors 201 | 202 | - @nicolasbaud made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/25 203 | 204 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.2.3...v1.2.4 205 | 206 | ## v1.2.3 - 2022-07-12 207 | 208 | ### What's Changed 209 | 210 | - chore(deps): bump dependabot/fetch-metadata from 1.3.1 to 1.3.3 by @dependabot in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/22 211 | - Add support for disk on download by @luilliarcec in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/23 212 | - Replace deprecated components by @luilliarcec in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/24 213 | 214 | ### New Contributors 215 | 216 | - @luilliarcec made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/23 217 | 218 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.2.2...v1.2.3 219 | 220 | ## v1.2.2 - 2022-06-02 221 | 222 | ### What's Changed 223 | 224 | - Fix Open modal open issue 225 | 226 | ## v1.2.1 - 2022-04-10 227 | 228 | ## What's Changed 229 | 230 | - Added Spanish translations by @pathros in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/13 231 | 232 | ## New Contributors 233 | 234 | - @pathros made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/13 235 | 236 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.2.0...v1.2.1 237 | 238 | ## v1.2.0 - 2022-02-11 239 | 240 | ## What's Changed 241 | 242 | - Add Brazilian Portuguese translate file by @felipe-balloni in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/4 243 | - Add support for Turkish (tr) translation by @trk in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/7 244 | - chore: laravel 9 support by @shuvroroy in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/8 245 | 246 | ## New Contributors 247 | 248 | - @felipe-balloni made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/4 249 | - @trk made their first contribution in https://github.com/shuvroroy/filament-spatie-laravel-backup/pull/7 250 | 251 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.1.0...v1.2.0 252 | 253 | ## v1.1.0 - 2022-01-17 254 | 255 | - page register via config file 256 | 257 | **Full Changelog**: https://github.com/shuvroroy/filament-spatie-laravel-backup/compare/v1.0.1...v1.1.0 258 | 259 | ## v1.0.1 - 2022-01-05 260 | 261 | - Fix wrong config key reference by @coziboy 262 | 263 | ## v1.0.0 - 2022-01-02 264 | 265 | - initial release 266 | 267 | ## 1.0.0 - 202X-XX-XX 268 | 269 | - initial release 270 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) shuvroroy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Filament Spatie Laravel Backup 2 | 3 | [![PHP Version Require](https://poser.pugx.org/shuvroroy/filament-spatie-laravel-backup/require/php)](https://packagist.org/packages/shuvroroy/filament-spatie-laravel-backup) 4 | [![Latest Stable Version](https://poser.pugx.org/shuvroroy/filament-spatie-laravel-backup/v)](https://packagist.org/packages/shuvroroy/filament-spatie-laravel-backup) 5 | [![Total Downloads](https://poser.pugx.org/shuvroroy/filament-spatie-laravel-backup/downloads)](https://packagist.org/packages/shuvroroy/filament-spatie-laravel-backup) 6 | [![License](https://poser.pugx.org/shuvroroy/filament-spatie-laravel-backup/license)](https://packagist.org/packages/shuvroroy/filament-spatie-laravel-backup) 7 | 8 | This package provides a Filament page that you can create backup of your application. You'll find installation instructions and full documentation on [spatie/laravel-backup](https://spatie.be/docs/laravel-backup/v7/introduction). 9 | 10 | Screenshot 2023-08-05 at 2 42 10 PM 11 | 12 | ## Installation 13 | 14 | You can install the package via composer: 15 | 16 | ```bash 17 | composer require shuvroroy/filament-spatie-laravel-backup 18 | ``` 19 | 20 | Publish the package's assets: 21 | 22 | ```bash 23 | php artisan filament:assets 24 | ``` 25 | 26 | You can publish the lang file with: 27 | 28 | ```bash 29 | php artisan vendor:publish --tag="filament-spatie-backup-translations" 30 | ``` 31 | 32 | ## Usage 33 | 34 | You first need to register the plugin with Filament. This can be done inside of your `PanelProvider`, e.g. `AdminPanelProvider`. 35 | 36 | ```php 37 | plugin(FilamentSpatieLaravelBackupPlugin::make()); 52 | } 53 | } 54 | ``` 55 | 56 | If you want to override the default `Backups` page icon, heading then you can extend the page class and override the `navigationIcon` property and `getHeading` method and so on. 57 | 58 | ```php 59 | plugin( 99 | FilamentSpatieLaravelBackupPlugin::make() 100 | ->usingPage(Backups::class) 101 | ); 102 | } 103 | } 104 | ``` 105 | 106 | ## Customising the polling interval 107 | 108 | You can customise the polling interval for the `Backups` by following the steps below: 109 | 110 | ```php 111 | plugin( 126 | FilamentSpatieLaravelBackupPlugin::make() 127 | ->usingPolingInterval('10s') // default value is 4s 128 | ); 129 | } 130 | } 131 | ``` 132 | 133 | ## Customising the queue 134 | 135 | You can customise the queue name for the `Backups` by following the steps below: 136 | 137 | ```php 138 | plugin( 153 | FilamentSpatieLaravelBackupPlugin::make() 154 | ->usingQueue('my-queue') // default value is null 155 | ); 156 | } 157 | } 158 | ``` 159 | 160 | ## Customising the timeout 161 | 162 | You can customise the timeout for the backup job by following the steps below: 163 | 164 | ```php 165 | plugin( 180 | FilamentSpatieLaravelBackupPlugin::make() 181 | ->timeout(120) // default value is max_execution_time from php.ini, or 30s if it wasn't defined 182 | ); 183 | } 184 | } 185 | ``` 186 | 187 | For more details refer to the [set_time_limit](https://www.php.net/manual/en/function.set-time-limit.php) function. 188 | 189 | You can also disable the timeout altogether to let the job run as long as needed: 190 | 191 | ```php 192 | plugin( 207 | FilamentSpatieLaravelBackupPlugin::make() 208 | ->noTimeout() 209 | ); 210 | } 211 | } 212 | ``` 213 | 214 | ## Customising who can access the page 215 | 216 | You can customise who can access the `Backups` page by adding an `authorize` method to the plugin. 217 | The method should return a boolean indicating whether the user is authorised to access the page. 218 | 219 | ```php 220 | plugin( 235 | FilamentSpatieLaravelBackupPlugin::make() 236 | ->authorize(fn (): bool => auth()->user()->email === 'admin@example.com'), 237 | ); 238 | } 239 | } 240 | ``` 241 | 242 | ## Upgrading 243 | 244 | Please see [UPGRADE](UPGRADE.md) for details on how to upgrade 1.X to 2.0. 245 | 246 | ## Testing 247 | 248 | ```bash 249 | composer test 250 | ``` 251 | 252 | ## Changelog 253 | 254 | Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. 255 | 256 | ## Contributing 257 | 258 | Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. 259 | 260 | ## Security Vulnerabilities 261 | 262 | Please review [our security policy](../../security/policy) on how to report security vulnerabilities. 263 | 264 | ## Credits 265 | 266 | - [Shuvro Roy](https://github.com/shuvroroy) 267 | - [All Contributors](../../contributors) 268 | 269 | ## License 270 | 271 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 272 | -------------------------------------------------------------------------------- /UPGRADE.md: -------------------------------------------------------------------------------- 1 | # Upgrade Guide 2 | 3 | ## Upgrading from v1.x to v2.0 4 | 5 | Starting with version v2.0, this package now only supports Filament v3.x. 6 | 7 | Follow these steps to update the package for Filament v3.x. 8 | 9 | 1. Update the package version in your `composer.json`. 10 | 2. Run `composer update`. 11 | 3. Register the plugin inside of your project's `PanelProvider`, e.g. `AdminPanelProvider`. 12 | 13 | ```php 14 | plugin(FilamentSpatieLaravelBackupPlugin::make()); 29 | } 30 | } 31 | ``` 32 | 33 | 4. Publish the plugin assets. 34 | 35 | ```sh 36 | php artisan filament:assets 37 | ``` 38 | 39 | 5. If you previously used the configuration file to change the `backups`, `interval` & `queue` value, those no longer exist and need to be updated to method calls on the plugin object. 40 | 41 | ```php 42 | plugin( 58 | FilamentSpatieLaravelBackupPlugin::make() 59 | ->usingPage(Backups::class) 60 | ->usingQueue('my-queue') 61 | ->usingPolingInterval('10s') // default value is 4s 62 | ->statusListRecordsTable(false) // default value is true 63 | ); 64 | } 65 | } 66 | ``` 67 | 68 | If you have any issues with the upgrade, please open an issue and provide details. Reproduction repositories are much appreciated. 69 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shuvroroy/filament-spatie-laravel-backup", 3 | "description": "This plugin is built on top of Spatie's Laravel-backup package", 4 | "keywords": [ 5 | "filament", 6 | "laravel-backup", 7 | "filament-spatie-laravel-backup" 8 | ], 9 | "homepage": "https://github.com/shuvroroy/filament-spatie-laravel-backup", 10 | "license": "MIT", 11 | "authors": [ 12 | { 13 | "name": "Shuvro Roy", 14 | "email": "shuvro.nsu.cse@gmail.com", 15 | "role": "Developer" 16 | } 17 | ], 18 | "require": { 19 | "php": "^8.1", 20 | "calebporzio/sushi": "^2.4|^2.5", 21 | "filament/filament": "^3.0", 22 | "spatie/laravel-backup": "^8.0|^9.0", 23 | "spatie/laravel-package-tools": "^1.15" 24 | }, 25 | "require-dev": { 26 | "laravel/pint": "^1.0", 27 | "nunomaduro/collision": "^8.1.1||^7.10.0", 28 | "larastan/larastan": "^2.9", 29 | "orchestra/testbench": "^9.0.0||^8.22.0", 30 | "pestphp/pest": "^2.0||^3.0", 31 | "pestphp/pest-plugin-arch": "^2.0||^3.0", 32 | "pestphp/pest-plugin-laravel": "^2.0||^3.0", 33 | "phpstan/extension-installer": "^1.3", 34 | "phpstan/phpstan-deprecation-rules": "^1.1", 35 | "phpstan/phpstan-phpunit": "^1.3" 36 | }, 37 | "autoload": { 38 | "psr-4": { 39 | "ShuvroRoy\\FilamentSpatieLaravelBackup\\": "src" 40 | } 41 | }, 42 | "autoload-dev": { 43 | "psr-4": { 44 | "ShuvroRoy\\FilamentSpatieLaravelBackup\\Tests\\": "tests" 45 | } 46 | }, 47 | "scripts": { 48 | "analyse": "vendor/bin/phpstan analyse", 49 | "test": "vendor/bin/pest", 50 | "format": "vendor/bin/pint" 51 | }, 52 | "config": { 53 | "sort-packages": true, 54 | "allow-plugins": { 55 | "pestphp/pest-plugin": true, 56 | "phpstan/extension-installer": true 57 | } 58 | }, 59 | "extra": { 60 | "laravel": { 61 | "providers": [ 62 | "ShuvroRoy\\FilamentSpatieLaravelBackup\\FilamentSpatieLaravelBackupServiceProvider" 63 | ] 64 | } 65 | }, 66 | "minimum-stability": "dev", 67 | "prefer-stable": true 68 | } 69 | -------------------------------------------------------------------------------- /mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/resources/dist/plugin.css": "/resources/dist/plugin.css" 3 | } 4 | -------------------------------------------------------------------------------- /pint.json: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "laravel", 3 | "rules": { 4 | "blank_line_before_statement": true, 5 | "concat_space": { 6 | "spacing": "one" 7 | }, 8 | "method_argument_space": true, 9 | "single_trait_insert_per_statement": true, 10 | "types_spaces": { 11 | "space": "single" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /resources/lang/ar/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'تحميل', 10 | 'delete' => 'حذف', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'المسار', 15 | 'disk' => 'قرص التخزين', 16 | 'date' => 'التاريخ', 17 | 'size' => 'الحجم', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'قرص التخزين', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'الإسم', 30 | 'disk' => 'قرص التخزين', 31 | 'healthy' => 'الحالة', 32 | 'amount' => 'السعة', 33 | 'newest' => 'الأحدث', 34 | 'used_storage' => 'السعة المستخدمة', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'إنشاء نسخة إحتياطية', 44 | ], 45 | 46 | 'heading' => 'النسخ الإحتياطي', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'إنشاء نسخة إحتياطية في الخلفية.', 50 | 'backup_delete_success' => 'تم حذف النسخة الإحتياطية بنجاح.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'قاعدة البيانات', 56 | 'only_files' => 'الملفات', 57 | 'db_and_files' => 'الملفات والقاعدة', 58 | ], 59 | 60 | 'label' => 'الرجاء الاختيار لإنشاء نسخة إحتياطية', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'إعدادات', 65 | 'label' => 'النسخ الإحتياطي', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/cs/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Stáhnout', 10 | 'delete' => 'Smazat', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Cesta', 15 | 'disk' => 'Disk', 16 | 'date' => 'Datum', 17 | 'size' => 'Velikost', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disk', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Název', 30 | 'disk' => 'Disk', 31 | 'healthy' => 'Stav zdraví', 32 | 'amount' => 'Počet', 33 | 'newest' => 'Nejnovější', 34 | 'used_storage' => 'Využité místo', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Vytvořit zálohu', 44 | ], 45 | 46 | 'heading' => 'Zálohy', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Nová záloha byla úspěšně vytvořena.', 50 | 'backup_delete_success' => '"Záloha byla úspěšně odstraněna.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'Pouze databáze', 56 | 'only_files' => 'Pouze soubory', 57 | 'db_and_files' => 'Databáze a soubory', 58 | ], 59 | 60 | 'label' => 'Vyberte prosím jednu z možností', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'Nastavení', 65 | 'label' => 'Zálohy', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/de/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Download', 10 | 'delete' => 'Löschen', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Pfad', 15 | 'disk' => 'Speicher', 16 | 'date' => 'Datum', 17 | 'size' => 'Größe', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Speicher', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Name', 30 | 'disk' => 'Speicher', 31 | 'healthy' => 'Gesund', 32 | 'amount' => 'Anzahl', 33 | 'newest' => 'Neuestes', 34 | 'used_storage' => 'Verwendeter Speicher', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Sicherung erstellen', 44 | ], 45 | 46 | 'heading' => 'Backups', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Erstelle eine neue Sicherung im Hintergrund.', 50 | 'backup_delete_success' => 'Lösche die Sicherung im Hintergrund.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'Nur DB', 56 | 'only_files' => 'Nur Dateien', 57 | 'db_and_files' => 'DB & Dateien', 58 | ], 59 | 60 | 'label' => 'Bitte eine Option auswählen', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'Einstellungen', 65 | 'label' => 'Sicherungen', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/en/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Download', 10 | 'delete' => 'Delete', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Path', 15 | 'disk' => 'Disk', 16 | 'date' => 'Date', 17 | 'size' => 'Size', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disk', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Name', 30 | 'disk' => 'Disk', 31 | 'healthy' => 'Healthy', 32 | 'amount' => 'Amount', 33 | 'newest' => 'Newest', 34 | 'used_storage' => 'Used Storage', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Create Backup', 44 | ], 45 | 46 | 'heading' => 'Backups', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Creating a new backup in background.', 50 | 'backup_delete_success' => 'Deleting this backup in background.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'Only DB', 56 | 'only_files' => 'Only Files', 57 | 'db_and_files' => 'DB & Files', 58 | ], 59 | 60 | 'label' => 'Please choose an option', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'Settings', 65 | 'label' => 'Backups', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/es/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Descargar', 10 | 'delete' => 'Eliminar', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Ruta', 15 | 'disk' => 'Disco', 16 | 'date' => 'Fecha', 17 | 'size' => 'Tamaño', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disco', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Nombre', 30 | 'disk' => 'Disco', 31 | 'healthy' => 'Estado', 32 | 'amount' => 'Cantidad', 33 | 'newest' => 'Más reciente', 34 | 'used_storage' => 'Espacio utilizado', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Hacer respaldo', 44 | ], 45 | 46 | 'heading' => 'Respaldos', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Creando un nuevo respaldo en segundo plano.', 50 | ], 51 | 52 | 'modal' => [ 53 | 'buttons' => [ 54 | 'only_db' => 'Solo la base de datos', 55 | 'only_files' => 'Solo los archivos', 56 | 'db_and_files' => 'Base de datos y archivos', 57 | ], 58 | 59 | 'label' => 'Elija una opción', 60 | ], 61 | 62 | 'navigation' => [ 63 | 'group' => 'Configuraciones', 64 | 'label' => 'Respaldos', 65 | ], 66 | ], 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /resources/lang/fa/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'دانلود', 10 | 'delete' => 'حذف', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'مسیر', 15 | 'disk' => 'دیسک', 16 | 'date' => 'تاریخ', 17 | 'size' => 'حجم', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'دیسک', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'نام', 30 | 'disk' => 'دیسک', 31 | 'healthy' => 'سالم', 32 | 'amount' => 'تعداد', 33 | 'newest' => 'جدیدترین', 34 | 'used_storage' => 'فضای استفاده شده', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'ایجاد پشتیبان', 44 | ], 45 | 46 | 'heading' => 'پشتیبان‌ها', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'در حال ایجاد پشتیبان در پس‌زمینه.', 50 | 'backup_delete_success' => 'در حال حذف این پشتیبان در پس‌زمینه.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'فقط دیتابیس', 56 | 'only_files' => 'فقط فایل‌ها', 57 | 'db_and_files' => 'فایل‌ها و دیتابیس', 58 | ], 59 | 60 | 'label' => 'یک گزینه را انتخاب کنید', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'تنظیمات', 65 | 'label' => 'پشتیبان‌ها', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/fr/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Télécharger', 10 | 'delete' => 'Supprimer', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Chemin d\'accès', 15 | 'disk' => 'Disque', 16 | 'date' => 'Date', 17 | 'size' => 'Taille', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disque', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Nom', 30 | 'disk' => 'Disque', 31 | 'healthy' => 'Statut', 32 | 'amount' => 'Montant', 33 | 'newest' => 'Plus récent', 34 | 'used_storage' => 'Stockage utilisé', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Créer une sauvegarde', 44 | ], 45 | 46 | 'heading' => 'Sauvegardes', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Création d\'une nouvelle sauvegarde en arrière-plan.', 50 | ], 51 | 52 | 'modal' => [ 53 | 'buttons' => [ 54 | 'only_db' => 'Seulement la base de données', 55 | 'only_files' => 'Seulement les fichiers', 56 | 'db_and_files' => 'Base de données & Fichiers', 57 | ], 58 | 59 | 'label' => 'Veuillez choisir une option', 60 | ], 61 | 62 | 'navigation' => [ 63 | 'group' => 'Paramètres', 64 | 'label' => 'Sauvegardes', 65 | ], 66 | ], 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /resources/lang/id/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Unduh', 10 | 'delete' => 'Hapus', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Lokasi', 15 | 'disk' => 'Penyimpanan', 16 | 'date' => 'Tanggal', 17 | 'size' => 'Ukuran', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Penyimpanan', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Nama', 30 | 'disk' => 'Penyimpanan', 31 | 'healthy' => 'Sehat', 32 | 'amount' => 'Jumlah', 33 | 'newest' => 'Terbaru', 34 | 'used_storage' => 'Penyimpanan Terpakai', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Buat Cadangan', 44 | ], 45 | 46 | 'heading' => 'Cadangan', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Membuat cadangan baru di latar belakang.', 50 | 'backup_delete_success' => 'Menghapus cadangan ini di latar belakang.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'Hanya DB', 56 | 'only_files' => 'Hanya Berkas', 57 | 'db_and_files' => 'DB & Berkas', 58 | ], 59 | 60 | 'label' => 'Silakan pilih salah satu opsi', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'Pengaturan', 65 | 'label' => 'Cadangan', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/it/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Download', 10 | 'delete' => 'Cancella', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Percorso', 15 | 'disk' => 'Disco', 16 | 'date' => 'Data', 17 | 'size' => 'Dimensione', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disco', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Nome', 30 | 'disk' => 'Disco', 31 | 'healthy' => 'Salute', 32 | 'amount' => 'Quantità', 33 | 'newest' => 'Più recente', 34 | 'used_storage' => 'Storage Utilizzato', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Crea Backup', 44 | ], 45 | 46 | 'heading' => 'Backup', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Creazione di un nuovo backup in background.', 50 | 'backup_delete_success' => 'Eliminazione di questo backup in background.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'Solo DB', 56 | 'only_files' => 'Solo File', 57 | 'db_and_files' => 'DB & File', 58 | ], 59 | 60 | 'label' => "Scegli un'opzione", 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'Impostazioni', 65 | 'label' => 'Backup', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/ko/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => '다운로드', 10 | 'delete' => '삭제', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => '경로', 15 | 'disk' => '디스크', 16 | 'date' => '날짜', 17 | 'size' => '크기', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => '디스크', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => '이름', 30 | 'disk' => '디스크', 31 | 'healthy' => '상태', 32 | 'amount' => '개수', 33 | 'newest' => '최신', 34 | 'used_storage' => '사용된 저장소', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => '백업 생성', 44 | ], 45 | 46 | 'heading' => '백업', 47 | 48 | 'messages' => [ 49 | 'backup_success' => '새 백업을 백그라운드에서 생성하는 중입니다.', 50 | 'backup_delete_success' => '이 백업을 백그라운드에서 삭제하는 중입니다.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => '데이터베이스만', 56 | 'only_files' => '파일만', 57 | 'db_and_files' => '데이터베이스 & 파일', 58 | ], 59 | 60 | 'label' => '옵션을 선택해 주세요', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => '설정', 65 | 'label' => '백업', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/nl/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Download', 10 | 'delete' => 'Verwijderen', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Pad', 15 | 'disk' => 'Disk', 16 | 'date' => 'Datum', 17 | 'size' => 'Grootte', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disk', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Naam', 30 | 'disk' => 'Disk', 31 | 'healthy' => 'Gezond', 32 | 'amount' => 'Aantal', 33 | 'newest' => 'Laatste', 34 | 'used_storage' => 'Gebruikte opslag', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Backup maken', 44 | ], 45 | 46 | 'heading' => 'Backups', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Backup maken in de achtergrond.', 50 | 'backup_delete_success' => 'Backup verwijderen in de achtergrond.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'Alleen DB', 56 | 'only_files' => 'Alleen bestanden', 57 | 'db_and_files' => 'DB en bestanden', 58 | ], 59 | 60 | 'label' => 'Kies een optie', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'Instellingen', 65 | 'label' => 'Backups', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/pt/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Download', 10 | 'delete' => 'Eliminar', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Caminho', 15 | 'disk' => 'Disco', 16 | 'date' => 'Data', 17 | 'size' => 'Tamanho', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disco', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Nome', 30 | 'disk' => 'Disco', 31 | 'healthy' => 'Estado', 32 | 'amount' => 'Quantidade', 33 | 'newest' => 'Recente', 34 | 'used_storage' => 'Espaço Utilizado', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Criar Cópia de Segurança', 44 | ], 45 | 46 | 'heading' => 'Cópias de Segurança', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'A criar uma nova cópia de segurança em segundo plano.', 50 | 'backup_delete_success' => 'A eliminar esta cópia de segurança em segundo plano.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'Apenas BD', 56 | 'only_files' => 'Apenas Ficheiros', 57 | 'db_and_files' => 'BD & Ficheiros', 58 | ], 59 | 60 | 'label' => 'Por favor, seleccione uma opção', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'Definições', 65 | 'label' => 'Cópias de Segurança', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/pt_BR/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Download', 10 | 'delete' => 'Excluir', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Caminho', 15 | 'disk' => 'Disco', 16 | 'date' => 'Data', 17 | 'size' => 'Tamanho', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disco', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Nome', 30 | 'disk' => 'Disco', 31 | 'healthy' => 'Saúde', 32 | 'amount' => 'Quant.', 33 | 'newest' => 'Recente', 34 | 'used_storage' => 'Espaço utilizado', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Criar Backup', 44 | ], 45 | 46 | 'heading' => 'Backups', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Criando um novo em segundo plano.', 50 | ], 51 | 52 | 'modal' => [ 53 | 'buttons' => [ 54 | 'only_db' => 'Apenas DB', 55 | 'only_files' => 'Apenas arquivos', 56 | 'db_and_files' => 'DB & Arquivos', 57 | ], 58 | 59 | 'label' => 'Por favor, escolha uma opção', 60 | ], 61 | 62 | 'navigation' => [ 63 | 'group' => 'Configurações', 64 | 'label' => 'Backups', 65 | ], 66 | ], 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /resources/lang/pt_PT/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Descarregar', 10 | 'delete' => 'Eliminar', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Caminho', 15 | 'disk' => 'Disco', 16 | 'date' => 'Data', 17 | 'size' => 'Tamanho', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disco', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Nome', 30 | 'disk' => 'Disco', 31 | 'healthy' => 'Estado', 32 | 'amount' => 'Quantidade', 33 | 'newest' => 'Recente', 34 | 'used_storage' => 'Espaço Utilizado', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Criar Cópia de Segurança', 44 | ], 45 | 46 | 'heading' => 'Cópias de Segurança', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'A criar uma nova cópia de segurança em segundo plano.', 50 | 'backup_delete_success' => 'A eliminar esta cópia de segurança em segundo plano.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'Apenas BD', 56 | 'only_files' => 'Apenas Ficheiros', 57 | 'db_and_files' => 'BD & Ficheiros', 58 | ], 59 | 60 | 'label' => 'Por favor, seleccione uma opção', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'Definições', 65 | 'label' => 'Cópias de Segurança', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/ru/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Скачать', 10 | 'delete' => 'Удалить', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Путь', 15 | 'disk' => 'Диск', 16 | 'date' => 'Дата', 17 | 'size' => 'Размер', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Диск', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Имя', 30 | 'disk' => 'Диск', 31 | 'healthy' => 'Исправен', 32 | 'amount' => 'Количество', 33 | 'newest' => 'Последний', 34 | 'used_storage' => 'Объём в хранилище', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Создать резервную копию', 44 | ], 45 | 46 | 'heading' => 'Резервные копии', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Создание новой резервной копии в фоновом режиме.', 50 | 'backup_delete_success' => 'Удаление этой резервной копии в фоновом режиме.', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => 'Только база', 56 | 'only_files' => 'Только файлы', 57 | 'db_and_files' => 'База и файлы', 58 | ], 59 | 60 | 'label' => 'Пожалуйста, выберите опцию', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => 'Настройки', 65 | 'label' => 'Резервные копии', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/lang/tr/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'İndir', 10 | 'delete' => 'Sil', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Yol', 15 | 'disk' => 'Disk', 16 | 'date' => 'Tarih', 17 | 'size' => 'Boyut', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Disk', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Ad', 30 | 'disk' => 'Disk', 31 | 'healthy' => 'Sağlık', 32 | 'amount' => 'Adet', 33 | 'newest' => 'Zaman', 34 | 'used_storage' => 'Kullanılan Depolama', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Yedek Oluştur', 44 | ], 45 | 46 | 'heading' => 'Yedekler', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Arka planda yeni bir yedek oluşturuluyor.', 50 | ], 51 | 52 | 'modal' => [ 53 | 'buttons' => [ 54 | 'only_db' => 'Sadece Veri Tabanı', 55 | 'only_files' => 'Sadece Dosyalar', 56 | 'db_and_files' => 'Veri Tabanı & Dosyalar', 57 | ], 58 | 59 | 'label' => 'Bir seçenek seçin', 60 | ], 61 | 62 | 'navigation' => [ 63 | 'group' => 'Ayarlar', 64 | 'label' => 'Yedekler', 65 | ], 66 | ], 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /resources/lang/vi/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => 'Tải xuống', 10 | 'delete' => 'Xóa', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => 'Đường dẫn', 15 | 'disk' => 'Ổ đĩa', 16 | 'date' => 'Ngày', 17 | 'size' => 'Kích thước', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => 'Ổ đĩa', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => 'Tên', 30 | 'disk' => 'Ổ đĩa', 31 | 'healthy' => 'Sức khỏe', 32 | 'amount' => 'Số lượng', 33 | 'newest' => 'Mới nhất', 34 | 'used_storage' => 'Bộ nhớ đã dùng', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => 'Tạo bản sao lưu', 44 | ], 45 | 46 | 'heading' => 'Sao lưu', 47 | 48 | 'messages' => [ 49 | 'backup_success' => 'Đang chạy tạo bản sao lưu dưới nền.', 50 | ], 51 | 52 | 'modal' => [ 53 | 'buttons' => [ 54 | 'only_db' => 'Chỉ DB', 55 | 'only_files' => 'Chỉ Tệp tin', 56 | 'db_and_files' => 'DB & Tệp tin', 57 | ], 58 | 59 | 'label' => 'Vui lòng chọn một tùy chọn', 60 | ], 61 | 62 | 'navigation' => [ 63 | 'group' => 'Cài đặt', 64 | 'label' => 'Sao lưu', 65 | ], 66 | ], 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /resources/lang/zh_CN/backup.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'backup_destination_list' => [ 7 | 'table' => [ 8 | 'actions' => [ 9 | 'download' => '下载', 10 | 'delete' => '删除', 11 | ], 12 | 13 | 'fields' => [ 14 | 'path' => '路径', 15 | 'disk' => '磁盘', 16 | 'date' => '日期', 17 | 'size' => '大小', 18 | ], 19 | 20 | 'filters' => [ 21 | 'disk' => '磁盘', 22 | ], 23 | ], 24 | ], 25 | 26 | 'backup_destination_status_list' => [ 27 | 'table' => [ 28 | 'fields' => [ 29 | 'name' => '文件名', 30 | 'disk' => '所属磁盘', 31 | 'healthy' => '健康状况', 32 | 'amount' => '大小', 33 | 'newest' => '最新备份', 34 | 'used_storage' => '占用空间', 35 | ], 36 | ], 37 | ], 38 | ], 39 | 40 | 'pages' => [ 41 | 'backups' => [ 42 | 'actions' => [ 43 | 'create_backup' => '创建备份', 44 | ], 45 | 46 | 'heading' => '数据备份', 47 | 48 | 'messages' => [ 49 | 'backup_success' => '在后台创建新备份', 50 | 'backup_delete_success' => '在后台删除此备份', 51 | ], 52 | 53 | 'modal' => [ 54 | 'buttons' => [ 55 | 'only_db' => '仅备份数据库', 56 | 'only_files' => '仅备份文件', 57 | 'db_and_files' => '备份数据库和文件', 58 | ], 59 | 60 | 'label' => '请选择一个选项', 61 | ], 62 | 63 | 'navigation' => [ 64 | 'group' => '系统设置', 65 | 'label' => '数据备份', 66 | ], 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/views/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuvroroy/filament-spatie-laravel-backup/f5dc08f1a4a282a4cebe32943e95f726240b83ca/resources/views/.gitkeep -------------------------------------------------------------------------------- /resources/views/components/backup-destination-list-records.blade.php: -------------------------------------------------------------------------------- 1 |
interval() }}> 2 | {{ $this->table }} 3 |
4 | -------------------------------------------------------------------------------- /resources/views/components/backup-destination-status-list-records.blade.php: -------------------------------------------------------------------------------- 1 |
interval() }}> 2 | {{ $this->table }} 3 |
4 | -------------------------------------------------------------------------------- /resources/views/pages/backups.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | @if($this->shouldDisplayStatusListRecords()) 4 |
5 | @livewire(ShuvroRoy\FilamentSpatieLaravelBackup\Components\BackupDestinationStatusListRecords::class) 6 |
7 | @endif 8 |
9 | @livewire(ShuvroRoy\FilamentSpatieLaravelBackup\Components\BackupDestinationListRecords::class) 10 |
11 | 12 | 13 | 14 |

{{ __('filament-spatie-backup::backup.pages.backups.modal.label') }}

15 |
16 | 17 | 18 |
19 | 20 | {{ __('filament-spatie-backup::backup.pages.backups.modal.buttons.only_db') }} 21 | 22 | 23 | 24 | {{ __('filament-spatie-backup::backup.pages.backups.modal.buttons.only_files') }} 25 | 26 | 27 | 28 | {{ __('filament-spatie-backup::backup.pages.backups.modal.buttons.db_and_files') }} 29 | 30 |
31 |
32 |
33 |
34 |
35 | -------------------------------------------------------------------------------- /src/Components/BackupDestinationListRecords.php: -------------------------------------------------------------------------------- 1 | |string> 29 | */ 30 | protected $queryString = [ 31 | 'tableSortColumn', 32 | 'tableSortDirection', 33 | 'tableSearchQuery' => ['except' => ''], 34 | ]; 35 | 36 | public function render(): View 37 | { 38 | return view('filament-spatie-backup::components.backup-destination-list-records'); 39 | } 40 | 41 | public function table(Table $table): Table 42 | { 43 | return $table 44 | ->query(BackupDestination::query()) 45 | ->columns([ 46 | Tables\Columns\TextColumn::make('path') 47 | ->label(__('filament-spatie-backup::backup.components.backup_destination_list.table.fields.path')) 48 | ->searchable() 49 | ->sortable(), 50 | Tables\Columns\TextColumn::make('disk') 51 | ->label(__('filament-spatie-backup::backup.components.backup_destination_list.table.fields.disk')) 52 | ->searchable() 53 | ->sortable(), 54 | Tables\Columns\TextColumn::make('date') 55 | ->label(__('filament-spatie-backup::backup.components.backup_destination_list.table.fields.date')) 56 | ->dateTime() 57 | ->searchable() 58 | ->sortable(), 59 | Tables\Columns\TextColumn::make('size') 60 | ->label(__('filament-spatie-backup::backup.components.backup_destination_list.table.fields.size')) 61 | ->badge(), 62 | ]) 63 | ->filters([ 64 | Tables\Filters\SelectFilter::make('disk') 65 | ->label(__('filament-spatie-backup::backup.components.backup_destination_list.table.filters.disk')) 66 | ->options(FilamentSpatieLaravelBackup::getFilterDisks()), 67 | ]) 68 | ->actions([ 69 | Tables\Actions\Action::make('download') 70 | ->label(__('filament-spatie-backup::backup.components.backup_destination_list.table.actions.download')) 71 | ->icon('heroicon-o-arrow-down-tray') 72 | ->visible(auth()->user()->can('download-backup')) 73 | ->action(fn (BackupDestination $record) => Storage::disk($record->disk)->download($record->path)), 74 | 75 | Tables\Actions\Action::make('delete') 76 | ->label(__('filament-spatie-backup::backup.components.backup_destination_list.table.actions.delete')) 77 | ->icon('heroicon-o-trash') 78 | ->visible(auth()->user()->can('delete-backup')) 79 | ->requiresConfirmation() 80 | ->color('danger') 81 | ->modalIcon('heroicon-o-trash') 82 | ->action(function (BackupDestination $record) { 83 | SpatieBackupDestination::create($record->disk, config('backup.backup.name')) 84 | ->backups() 85 | ->first(function (Backup $backup) use ($record) { 86 | return $backup->path() === $record->path; 87 | }) 88 | ->delete(); 89 | 90 | Notification::make() 91 | ->title(__('filament-spatie-backup::backup.pages.backups.messages.backup_delete_success')) 92 | ->success() 93 | ->send(); 94 | }), 95 | ]) 96 | ->bulkActions([ 97 | // ... 98 | ]); 99 | } 100 | 101 | #[Computed] 102 | public function interval(): string 103 | { 104 | /** @var FilamentSpatieLaravelBackupPlugin $plugin */ 105 | $plugin = filament()->getPlugin('filament-spatie-backup'); 106 | 107 | return $plugin->getPolingInterval(); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/Components/BackupDestinationStatusListRecords.php: -------------------------------------------------------------------------------- 1 | query(BackupDestinationStatus::query()) 31 | ->columns([ 32 | Tables\Columns\TextColumn::make('name') 33 | ->label(__('filament-spatie-backup::backup.components.backup_destination_status_list.table.fields.name')), 34 | Tables\Columns\TextColumn::make('disk') 35 | ->label(__('filament-spatie-backup::backup.components.backup_destination_status_list.table.fields.disk')), 36 | Tables\Columns\IconColumn::make('healthy') 37 | ->label(__('filament-spatie-backup::backup.components.backup_destination_status_list.table.fields.healthy')) 38 | ->boolean(), 39 | Tables\Columns\TextColumn::make('amount') 40 | ->label(__('filament-spatie-backup::backup.components.backup_destination_status_list.table.fields.amount')), 41 | Tables\Columns\TextColumn::make('newest') 42 | ->label(__('filament-spatie-backup::backup.components.backup_destination_status_list.table.fields.newest')), 43 | Tables\Columns\TextColumn::make('usedStorage') 44 | ->label(__('filament-spatie-backup::backup.components.backup_destination_status_list.table.fields.used_storage')) 45 | ->badge(), 46 | ]) 47 | ->filters([ 48 | // ... 49 | ]) 50 | ->actions([ 51 | // ... 52 | ]) 53 | ->bulkActions([ 54 | // ... 55 | ]); 56 | } 57 | 58 | #[Computed] 59 | public function interval(): string 60 | { 61 | /** @var FilamentSpatieLaravelBackupPlugin $plugin */ 62 | $plugin = filament()->getPlugin('filament-spatie-backup'); 63 | 64 | return $plugin->getPolingInterval(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/Enums/Option.php: -------------------------------------------------------------------------------- 1 | addSeconds(4), function () use ($disk) { 41 | return BackupDestination::create($disk, config('backup.backup.name')) 42 | ->backups() 43 | ->map(function (Backup $backup) use ($disk) { 44 | return [ 45 | 'disk' => $disk, 46 | 'path' => $backup->path(), 47 | 'date' => $backup->date()->format('Y-m-d H:i:s'), 48 | 'size' => Format::humanReadableSize($backup->sizeInBytes()), 49 | ]; 50 | }) 51 | ->toArray(); 52 | }); 53 | } 54 | 55 | public static function getBackupDestinationStatusData(): array 56 | { 57 | return Cache::remember('backup-statuses', now()->addSeconds(4), function () { 58 | $config = class_exists('Spatie\Backup\Config\MonitoredBackupsConfig') 59 | ? MonitoredBackupsConfig::fromArray(config('backup.monitor_backups')) 60 | : config('backup.monitor_backups'); 61 | 62 | return BackupDestinationStatusFactory::createForMonitorConfig($config) 63 | ->map(function (BackupDestinationStatus $backupDestinationStatus, int | string $key) { 64 | return [ 65 | 'id' => $key, 66 | 'name' => $backupDestinationStatus->backupDestination()->backupName(), 67 | 'disk' => $backupDestinationStatus->backupDestination()->diskName(), 68 | 'reachable' => $backupDestinationStatus->backupDestination()->isReachable(), 69 | 'healthy' => $backupDestinationStatus->isHealthy(), 70 | 'amount' => $backupDestinationStatus->backupDestination()->backups()->count(), 71 | 'newest' => $backupDestinationStatus->backupDestination()->newestBackup() 72 | ? $backupDestinationStatus->backupDestination()->newestBackup()->date()->diffForHumans() 73 | : __('No backups present'), 74 | 'usedStorage' => Format::humanReadableSize($backupDestinationStatus->backupDestination()->usedStorage()), 75 | ]; 76 | }) 77 | ->values() 78 | ->toArray(); 79 | }); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/FilamentSpatieLaravelBackupPlugin.php: -------------------------------------------------------------------------------- 1 | pages([$this->getPage()]); 29 | } 30 | 31 | public function boot(Panel $panel): void 32 | { 33 | // 34 | } 35 | 36 | public function authorize(bool | \Closure $callback = true): static 37 | { 38 | $this->authorizeUsing = $callback; 39 | 40 | return $this; 41 | } 42 | 43 | public function isAuthorized(): bool 44 | { 45 | return $this->evaluate($this->authorizeUsing) === true; 46 | } 47 | 48 | public static function get(): static 49 | { 50 | /** @var static $instance */ 51 | $instance = filament(app(static::class)->getId()); 52 | 53 | return $instance; 54 | } 55 | 56 | public function getId(): string 57 | { 58 | return 'filament-spatie-backup'; 59 | } 60 | 61 | public static function make(): static 62 | { 63 | return new static; 64 | } 65 | 66 | public function usingPage(string $page): static 67 | { 68 | $this->page = $page; 69 | 70 | return $this; 71 | } 72 | 73 | public function getPage(): string 74 | { 75 | return $this->page; 76 | } 77 | 78 | public function usingQueue(string $queue): static 79 | { 80 | $this->queue = $queue; 81 | 82 | return $this; 83 | } 84 | 85 | public function getQueue(): ?string 86 | { 87 | return $this->queue; 88 | } 89 | 90 | public function usingPolingInterval(string $interval): static 91 | { 92 | $this->interval = $interval; 93 | 94 | return $this; 95 | } 96 | 97 | public function getPolingInterval(): string 98 | { 99 | return $this->interval; 100 | } 101 | 102 | /** 103 | * Set the timeout (in seconds) used for the backup job. If set to 0, the job will never timeout. 104 | * 105 | * @see https://www.php.net/manual/en/function.set-time-limit.php 106 | */ 107 | public function timeout(int $seconds): static 108 | { 109 | $this->timeout = $seconds; 110 | 111 | return $this; 112 | } 113 | 114 | /** 115 | * Make it so that the backup job will never timeout. 116 | * 117 | * @see https://www.php.net/manual/en/function.set-time-limit.php 118 | */ 119 | public function noTimeout(): static 120 | { 121 | return $this->timeout(0); 122 | } 123 | 124 | public function getTimeout(): ?int 125 | { 126 | return $this->timeout; 127 | } 128 | 129 | public function statusListRecordsTable(bool $condition = true): static 130 | { 131 | $this->hasStatusListRecordsTable = $condition; 132 | 133 | return $this; 134 | } 135 | 136 | public function hasStatusListRecordsTable(): bool 137 | { 138 | return $this->hasStatusListRecordsTable; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /src/FilamentSpatieLaravelBackupServiceProvider.php: -------------------------------------------------------------------------------- 1 | name('filament-spatie-backup') 17 | ->hasTranslations() 18 | ->hasViews(); 19 | } 20 | 21 | public function packageBooted(): void 22 | { 23 | Livewire::component('backup-destination-list-records', BackupDestinationListRecords::class); 24 | Livewire::component('backup-destination-status-list-records', BackupDestinationStatusListRecords::class); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Jobs/CreateBackupJob.php: -------------------------------------------------------------------------------- 1 | $this->option === Option::ONLY_DB, 28 | '--only-files' => $this->option === Option::ONLY_FILES, 29 | '--filename' => match ($this->option) { 30 | Option::ALL => null, 31 | default => str_replace('_', '-', $this->option->value) . 32 | '-' . date('Y-m-d-H-i-s') . '.zip' 33 | }, 34 | '--timeout' => $this->timeout, 35 | ]); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Models/BackupDestination.php: -------------------------------------------------------------------------------- 1 | button() 39 | ->label(__('filament-spatie-backup::backup.pages.backups.actions.create_backup')) 40 | ->action('openOptionModal'), 41 | ]; 42 | } 43 | 44 | public function openOptionModal(): void 45 | { 46 | $this->dispatch('open-modal', id: 'backup-option'); 47 | } 48 | 49 | public function create(string $option = ''): void 50 | { 51 | /** @var FilamentSpatieLaravelBackupPlugin $plugin */ 52 | $plugin = filament()->getPlugin('filament-spatie-backup'); 53 | 54 | CreateBackupJob::dispatch(Option::from($option), $plugin->getTimeout()) 55 | ->onQueue($plugin->getQueue()) 56 | ->afterResponse(); 57 | 58 | $this->dispatch('close-modal', id: 'backup-option'); 59 | 60 | Notification::make() 61 | ->title(__('filament-spatie-backup::backup.pages.backups.messages.backup_success')) 62 | ->success() 63 | ->send(); 64 | } 65 | 66 | public function shouldDisplayStatusListRecords(): bool 67 | { 68 | /** @var FilamentSpatieLaravelBackupPlugin $plugin */ 69 | $plugin = filament()->getPlugin('filament-spatie-backup'); 70 | 71 | return $plugin->hasStatusListRecordsTable(); 72 | } 73 | 74 | public static function canAccess(): bool 75 | { 76 | return FilamentSpatieLaravelBackupPlugin::get()->isAuthorized(); 77 | } 78 | } 79 | --------------------------------------------------------------------------------