• Stars
    star
    305
  • Rank 136,879 (Top 3 %)
  • Language
    PHP
  • License
    Other
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Admin interface for managing database and file backups in Backpack for Laravel

Backpack\BackupManager

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Style CI Total Downloads

An admin interface for spatie/laravel-backup. Allows the admin to easily manage backups (download and delete). Used in the Backpack package, on Laravel 5.2+ to 9.

Security updates and breaking changes

Please subscribe to the Backpack Newsletter so you can find out about any security updates, breaking changes or major features. We send an email 2 times/year, max.

Backpack\BackupManager screenshot

Install

  1. In your terminal:
# Install the package
composer require backpack/backupmanager

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

# [optional] 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>"
  1. [optional] Instruct Laravel to run the backups automatically in your console kernel:
// app/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // if you are not using notifications you should add the `--disable-notifications` flag to this commands
    $schedule->command('backup:clean')->daily()->at('04:00');
    $schedule->command('backup:run')->daily()->at('05:00');
}
  1. 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. You can do that in your config/database.php file, where you define your database credentials, by adding the dump variables. Here's an example:

'mysql' => [
    'driver'            => 'mysql',
    'host'              => env('DB_HOST', 'localhost'),
    'database'          => env('DB_DATABASE', 'forge'),
    'username'          => env('DB_USERNAME', 'forge'),
    'password'          => env('DB_PASSWORD', ''),
    'charset'           => 'utf8',
    'collation'         => 'utf8_unicode_ci',
    'prefix'            => '',
    'strict'            => false,
    'engine'            => null,
    'dump' => [

        'dump_binary_path' => '/path/to/directory/', // only the path, without `mysqldump` or `pg_dump`
        // 'dump_binary_path' => '/Applications/MAMP/Library/bin/', // works for MAMP on Mac OS
        // 'dump_binary_path' => '/opt/homebrew/bin/', // works for Laravel Valet on Mac OS
        'use_single_transaction',
        'timeout' => 60 * 5, // 5 minute timeout
        // 'exclude_tables' => ['table1', 'table2'],
        // 'add_extra_option' => '--optionname=optionvalue',
    ]
],

Usage

This should be a point-and-click interface where you can create and download backups at any time.

Try at your-project-domain/admin/backup

Configuration & Troubleshooting

For additional configuration (eg. notifications):

  • publish the spatie backup file php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider" --tag="backup-config"
  • see the spatie/laravel-backup documentation on how to configure your backup system in config/backup.php; it is higly recommended that you at least configure the notifications;
  • see config/backpack/backupmanager.php for configurating how the backup is run from the interface; by default, it does backup:run --disable-notifications, but after you've configured notifications, you can remove that flag (or add others);

[TIP] When you modify your options in config/backup.php or config/backpack/backupmanager.php, please run manually php artisan backup:run to make sure it's still working after your changes. NOTE: php artisan optimize:clear and/or php artisan config:clear might be needed before the backup:run command.

Upgrading

Please see the upgrade guides to get:

  • from v3 to v4 (new!)
  • from v2 to v3
  • from 1.2.x to 1.3.x
  • from 1.1.x to 1.2.x

Change log

Please see the releases page for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Overwriting Functionality

If you need to modify how this works in a project:

  • create a routes/backpack/backupmanager.php file; the package will see that, and load your routes file, instead of the one in the package;
  • create controllers/models that extend the ones in the package, and use those in your new routes file;
  • modify anything you'd like in the new controllers/models;

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Please subscribe to the Backpack Newsletter so you can find out about any security updates, breaking changes or major features. We send an email every 1-2 months.

Credits

License

The MIT License (MIT). Please see License File for more information.

Hire us

We've spend more than 10.000 hours creating, polishing and maintaining administration panels on Laravel. We've developed e-Commerce, e-Learning, ERPs, social networks, payment gateways and much more. We've worked on admin panels so much, that we've created one of the most popular software in its niche - just from making public what was repetitive in our projects.

If you are looking for a developer/team to help you build an admin panel on Laravel, look no further. You'll have a difficult time finding someone with more experience & enthusiasm for this. This is what we do. Contact us - let's see if we can work together.

More Repositories

1

CRUD

Build custom admin panels. Fast!
PHP
2,816
star
2

Base

Until 2018, Backpack v3 used this Base package to offer admin authentication and a blank admin panel using AdminLTE. Backpack v4 no longer uses this package, they're now built-in - use Backpack/CRUD instead.
PHP
891
star
3

PermissionManager

Admin interface for managing users, roles, permissions, using Backpack CRUD
PHP
481
star
4

demo

A working demo of Laravel with all Backpack packages installed.
PHP
301
star
5

Generators

Generate files for Backpack projects
PHP
296
star
6

PageManager

Administer presentation pages in Laravel, using page templates and Backpack\CRUD
PHP
279
star
7

LogManager

An interface to preview, download and delete Laravel log files, using Backpack.
PHP
261
star
8

Settings

Application settings interface for Backpack (for Laravel 6).
PHP
228
star
9

NewsCRUD

An admin panel for news with categories and tags, using Backpack CRUD on Laravel 10
PHP
205
star
10

MenuCRUD

An admin panel for menu items, using Backpack\CRUD on Laravel 6 or 7.
Blade
182
star
11

LangFileManager

A quick interface to edit Laravel language files, for Backpack.
PHP
90
star
12

FileManager

Admin interface for files & folders, using elFinder.
PHP
79
star
13

docs

45
star
14

revise-operation

An admin interface for venturecraft/revisionable - audit log for your Eloquent entries.
PHP
42
star
15

basset

Better asset helpers for Laravel apps.
PHP
36
star
16

community-forum

A workspace to discuss improvement and feature ideas, before they're actually implemented.
25
star
17

theme-tabler

UI for Backpack v6 that uses Tabler and Bootstrap v5.
Blade
16
star
18

activity-log

PHP
13
star
19

download-operation

PHP
10
star
20

medialibrary-uploaders

PHP
8
star
21

language-switcher

Multi language dropdown for Backpack v6
PHP
7
star
22

addons

A place for the Backpack community to talk about possible Backpack add-ons.
5
star
23

theme-coreuiv2

UI that uses CoreUI v2 and Bootstrap v4, provided as a legacy theme for Backpack v6.
Blade
4
star
24

theme-coreuiv4

UI for Backpack v6 that uses CoreUI v4 and Bootstrap v5.
Blade
3
star
25

devtools-issues

Bug reports and feature requests for our closed-source DevTools package
3
star
26

legal-documents

All legal documents for the Backpack organisation. Full transparency.
1
star