Skip to content

Commit a461313

Browse files
authored
Merge pull request #111 from Laravel-Backpack/revert-110-revert-104-remove-v3-config-file
Revert "Revert "removed v3 config file in order to work with any version of spatie/laravel-backup""
2 parents ce7cfa0 + add9d8e commit a461313

File tree

3 files changed

+29
-261
lines changed

3 files changed

+29
-261
lines changed

README.md

+29-7
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ An admin interface for [spatie/laravel-backup](https://github.com/spatie/laravel
2525
# Install the package
2626
composer require backpack/backupmanager
2727

28-
# Publish the config file and lang files:
29-
php artisan vendor:publish --provider="Backpack\BackupManager\BackupManagerServiceProvider" --tag=config
30-
31-
# [optional] Add a sidebar_content item for it
28+
# Add a sidebar_content item for it
3229
php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-link' href='{{ backpack_url('backup') }}'><i class='nav-icon la la-hdd-o'></i> Backups</a></li>"
3330
```
3431

@@ -43,9 +40,34 @@ php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-lin
4340
```
4441
This is where you choose a different driver if you want your backups to be stored somewhere else (S3, Dropbox, Google Drive, Box, etc).
4542

46-
3) [optional] Modify your backup options in ```config/backup.php```, then run ```php artisan backup:run``` to make sure it's still working.
43+
3) [optional] You can add backup flags for when the backup process is run from the user interface. In your `config/backup.php` under the `backup` key you can add the `backpack_flags` array below:
44+
45+
```php
46+
'backup' => [
47+
48+
/* --------------------------------------
49+
* Backpack\BackupManager Command Flags
50+
* --------------------------------------
51+
* These flags will be attached every time a backup is triggered
52+
* by Backpack\BackupManager. By default only notifications are disabled.
53+
*
54+
* https://docs.spatie.be/laravel-backup/v4/taking-backups/overview
55+
* --only-to-disk=name-of-your-disk
56+
* --only-db
57+
* --only-files
58+
* --disable-notifications
59+
*/
60+
'backpack_flags' => [
61+
'--disable-notifications'=> true,
62+
],
63+
64+
// ...
65+
],
66+
```
67+
68+
4) [optional] Modify your backup options in ```config/backup.php``` (which is `spatie/laravel-backup`'s config file), then run ```php artisan backup:run``` to make sure it's still working.
4769

48-
4) [optional] Instruct Laravel to run the backups automatically in your console kernel:
70+
5) [optional] Instruct Laravel to run the backups automatically in your console kernel:
4971

5072
```php
5173
// app/Console/Kernel.php
@@ -57,7 +79,7 @@ protected function schedule(Schedule $schedule)
5779
}
5880
```
5981

60-
5) Check that it works
82+
6) Check that it works
6183

6284
If the "unknown error" yellow bubble is thrown and you see the "_Backup failed because The dump process failed with exitcode 127 : Command not found._" error in the log file, either mysqldump / pg_dump is not installed or you need to specify its location.
6385

src/BackupManagerServiceProvider.php

-13
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ class BackupManagerServiceProvider extends ServiceProvider
2828
*/
2929
public function boot()
3030
{
31-
// use the vendor configuration file as fallback
32-
$this->mergeConfigFrom(
33-
__DIR__.'/config/backup.php',
34-
'backpack.backupmanager'
35-
);
36-
3731
// LOAD THE VIEWS
3832
// - first the published/overwritten views (in case they have any changes)
3933
$customViewsFolder = resource_path('views/vendor/backpack/backupmanager');
@@ -44,8 +38,6 @@ public function boot()
4438
// - then the stock views that come with the package, in case a published view might be missing
4539
$this->loadViewsFrom(realpath(__DIR__.'/resources/views'), 'backupmanager');
4640

47-
// publish config file
48-
$this->publishes([__DIR__.'/config/backup.php' => config_path('backup.php')], 'config');
4941
// publish lang files
5042
$this->publishes([__DIR__.'/resources/lang' => resource_path('lang/vendor/backpack')], 'lang');
5143
// publish the views
@@ -80,10 +72,5 @@ public function setupRoutes(Router $router)
8072
public function register()
8173
{
8274
$this->setupRoutes($this->app->router);
83-
84-
// use this if your package has a config file
85-
config([
86-
'config/backup.php',
87-
]);
8875
}
8976
}

src/config/backup.php

-241
This file was deleted.

0 commit comments

Comments
 (0)