Skip to content

Commit

Permalink
Merge pull request #111 from Laravel-Backpack/revert-110-revert-104-r…
Browse files Browse the repository at this point in the history
…emove-v3-config-file

Revert "Revert "removed v3 config file in order to work with any version of spatie/laravel-backup""
  • Loading branch information
tabacitu committed Apr 5, 2022
2 parents ce7cfa0 + add9d8e commit a461313
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 261 deletions.
36 changes: 29 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ An admin interface for [spatie/laravel-backup](https://github.com/spatie/laravel
# Install the package
composer require backpack/backupmanager

# Publish the config file and lang files:
php artisan vendor:publish --provider="Backpack\BackupManager\BackupManagerServiceProvider" --tag=config

# [optional] Add a sidebar_content item for it
# Add a sidebar_content item for it
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>"
```

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

3) [optional] Modify your backup options in ```config/backup.php```, then run ```php artisan backup:run``` to make sure it's still working.
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:

```php
'backup' => [

/* --------------------------------------
* Backpack\BackupManager Command Flags
* --------------------------------------
* These flags will be attached every time a backup is triggered
* by Backpack\BackupManager. By default only notifications are disabled.
*
* https://docs.spatie.be/laravel-backup/v4/taking-backups/overview
* --only-to-disk=name-of-your-disk
* --only-db
* --only-files
* --disable-notifications
*/
'backpack_flags' => [
'--disable-notifications'=> true,
],

// ...
],
```

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.

4) [optional] Instruct Laravel to run the backups automatically in your console kernel:
5) [optional] Instruct Laravel to run the backups automatically in your console kernel:

```php
// app/Console/Kernel.php
Expand All @@ -57,7 +79,7 @@ protected function schedule(Schedule $schedule)
}
```

5) Check that it works
6) Check that it works

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.

Expand Down
13 changes: 0 additions & 13 deletions src/BackupManagerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ class BackupManagerServiceProvider extends ServiceProvider
*/
public function boot()
{
// use the vendor configuration file as fallback
$this->mergeConfigFrom(
__DIR__.'/config/backup.php',
'backpack.backupmanager'
);

// LOAD THE VIEWS
// - first the published/overwritten views (in case they have any changes)
$customViewsFolder = resource_path('views/vendor/backpack/backupmanager');
Expand All @@ -44,8 +38,6 @@ public function boot()
// - then the stock views that come with the package, in case a published view might be missing
$this->loadViewsFrom(realpath(__DIR__.'/resources/views'), 'backupmanager');

// publish config file
$this->publishes([__DIR__.'/config/backup.php' => config_path('backup.php')], 'config');
// publish lang files
$this->publishes([__DIR__.'/resources/lang' => resource_path('lang/vendor/backpack')], 'lang');
// publish the views
Expand Down Expand Up @@ -80,10 +72,5 @@ public function setupRoutes(Router $router)
public function register()
{
$this->setupRoutes($this->app->router);

// use this if your package has a config file
config([
'config/backup.php',
]);
}
}
241 changes: 0 additions & 241 deletions src/config/backup.php

This file was deleted.

0 comments on commit a461313

Please sign in to comment.