Giter VIP home page Giter VIP logo

laravel-backup-panel's Introduction

Laravel Backup Panel

Latest Version on Packagist Build Status Tests Quality Score StyleCI Total Downloads

Laravel Backup Panel provides a dashboard for spatie/laravel-backup package. It lets you:

  • create a backup (full | only database | only files)
  • check the health of your backups
  • list all backups
  • download a backup
  • delete a backup
  • monitor used disk storage

Screenshot

It resembles the look and functionality of another Spatie package: spatie/nova-backup-tool. This was done on purpose, so users can easily migrate from one to another. Only it doesn't use polling. A "real-time" updates of a backups list isn't such a necessarily thing and an intensive polling can cause unexpected charges if you use services that require to pay per API requests, such as Google Cloud Storage. Also, some users reported about hitting a rate limit of Dropbox API.

Requirements

Make sure you meet the requirements for installing spatie/laravel-backup. Since this package requires the spatie/laravel-backup version 6.11.12 or higher, it also requires PHP 7.3 and Laravel 6.0 or higher.

Using an older version of PHP, Laravel, spatie/laravel-backup?

Just use the older version of this package, see the v1 branch.

Installation

First you must install spatie/laravel-backup into your Laravel app. The installation instructions are here. When successful, running php artisan backup:run on the terminal should create a backup and php artisan backup:list should return a list with an overview of all backup disks.

You may use composer to install Laravel Backup Panel into your project:

$ composer require pavel-mironchik/laravel-backup-panel

After installing, publish its resources using provided Artisan command:

$ php artisan laravel-backup-panel:install

This will do the following:

  • place CSS files into public/vendor/laravel_backup_panel directory
  • place Blade templates into resources/views/vendor/laravel_backup_panel directory
  • add config file config/laravel_backup_panel.php
  • register service provider app/Providers/LaravelBackupPanelServiceProvider.php

Updating

When updating the package, do not forget to re-publish resources:

$ php artisan vendor:publish --tag=laravel-backup-panel-assets --force
$ php artisan vendor:publish --tag=laravel-backup-panel-views --force

Upgrading

See the Wiki for the instructions how to upgrade from version 1.

Configuration

You are free to tune CSS styles in the public/vendor/laravel_backup_panel directory and change the layout in the resources/views/vendor/laravel_backup_panel directory as you want.

Laravel Backup Panel exposes a dashboard at /backup. Change it in config/laravel_backup_panel.php file:

'path' => 'backup',

Sometimes you don't want to run backup jobs on the same queue as user actions and things that is more time critical. Specify your desired queue name in config/laravel_backup_panel.php file:

'queue' => 'dedicated_low_priority_queue',

By default, you will only be able to access the dashboard in the local environment. To change that, modify authorization gate in the app/Providers/LaravelBackupPanelServiceProvider.php:

/**
 * Register the Laravel Backup Panel gate.
 *
 * This gate determines who can access Laravel Backup Panel in non-local environments.
 *
 * @return void
 */
protected function gate()
{
    Gate::define('viewLaravelBackupPanel', function ($user) {
        return in_array($user->email, [
            '[email protected]',
        ]);
    });
}

Usage

Open http://your-site/backup. You'll see a dashboard and controls to use.

Changelog

Please see CHANGELOG for more information about what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Testing

$ composer test

Security

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

Support

If you like this package, consider supporting it. You can use this in such ways:

  1. If you don't have a Digital Ocean account yet - use this link https://m.do.co/c/d9cd33e44510 to register one. You will get $100 in credit over 60 days, and once you spent $25 - I will get $25 too. This will cover the cost of hosting my nonprofit open-source projects there.
  2. If you have some Laravel/Vue project/work to be done, then contact me - [email protected]. I work as a freelancer (mostly at UpWork), and such a project can pay my bills.

And any other help will be appreciated.

Credits

License

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

laravel-backup-panel's People

Contributors

dependabot[bot] avatar lloricode avatar pavel-mironchik avatar stylecibot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

laravel-backup-panel's Issues

Protect route /backup

Hi I would like protect the route /backup to only auth users. I have created a route in the web.php which has the routes of the project.

Route::group([
    'middleware' => 'auth',
    'prefix'     => '/admin',
    'as'         => 'admin.'
], function () {

   Route::get('/backup', [BackupController::class, 'index'])->name("backup");
  ...
  ...
 other routes...

});

By the moment in local mode or debug mode any users that knows the route /backup can access and make backups, I have added that route and only works redirecting to login when the user go to /admin/backup, but if him go directly to /backup can access and does not matter if him did login, how I can prevent it?

My idea after fix it create the roles and permissions using laravel spatie permission package and I need to create slugs to each permission like 'admin.backup', admin.user.index etc.. I don't wan restrict this route by using and email of the auth user my idea is restrict this route by using role and permissions but first I want restrict this route to only auth users, by the moment anyone hwo knows the route /backup can access and make backups.

Update
After write this issue, I fixed the problem. I found the file web.php inside of vendor->pavel-mironchik->laravel-backup-panel->routes->web.php and I added the middleware auth to default route:

<?php
use Illuminate\Support\Facades\Route;

Route::view('/', 'laravel_backup_panel::layout')->middleware('auth')->name("backup.index");

Of this way only auth users can access that route.
Now Using the middleware 'can' for permissions I should do something like this:

Route::view('/', 'laravel_backup_panel::layout')->middleware('can:admin.backup.index')->middleware('auth')->name("backup.index");
Of this way I think that only the users with the permission admin.backup.index could access to the routes /backup
Is correct this? I'm not laravel expert, sorry.
I think that it's correct because I have one inframe calling the route 'backup.index' and by the moment the access is restricted:

image

thanks so much.

Customize view

Is there an option to customize view? So it can be fitted in existing application layout.

Maybe publish --tag=views

array_merge(): Expected parameter 1 to be an array, null given

As of now I just installed and configured this package after following the steps in the main repo page. I am suddenly stuck with this error:
array_merge(): Expected parameter 1 to be an array, null given.

Here is my package.json
image

Here is my config/laravel_backup_panel.php
image

Also here is the error :
image

The dump process failed with a none successful exitcode.

Hello, thanks for the package. Am able to successfully create a files backup but when I try to create a database backup, I get

Exitcode ======== 127: Command not found Output ====== <no output> Error Output ============ sh: mysqldump: command not found

Listeners not available

I am using livewire powergrid for displaying backup files. I am unable to call downloadFile from powergrid component.

support Laravel 5.5.*

Problem 1
- Installation request for pavel-mironchik/laravel-backup-panel ^1.3 -> satisfiable by pavel-mironchik/laravel-backup-panel[v1.3.0].
- pavel-mironchik/laravel-backup-panel v1.3.0 requires spatie/laravel-backup ^6.7 -> satisfiable by spatie/laravel-backup[6.7.0, 6.7.1, 6.7.2, 6.7.3, 6.7.4, 6.7.5, 6.7.6] but these conflict with your requirements or minimum-stability.

Redis

Hello, could you help me?

I'm a little confused between your package and spatie's.

When I configure my "QUEUE_CONNECTION" with "sync" in this case it works if i put "redis" doesn't work.

Is there any way that can I use your package by configuring it to use com redis?

Unable to download backup (file size 270mb)

Download works for small file like only db but when I click download button on large file (270mb) it shows following error:

Error 503. Service Unavailable

The server is temporarily unavailable. Please check back shortly. If this problem persists, please contact our Technical Support department.

Error when restoring a database after backup - pg_restore: error: input file appears to be a text format dump. Please use psql.

Hi dear,
After create one backup by using laravel backup panel and import it by using pgadmin because my database is a postgresql it throwed one error:
pg_restore: error: input file appears to be a text format dump. Please use psql.
My DB_CONNECTION is =pgsql
Before I installed laravel backup from spatie v6.
By the moment the backups are being done successfully but when I try to restore a database by using this backup pgadmin v4 is throwing the error of above.

I don't know what to do, in local mode I'm working with mysql database but in production I'm using postgresql.
This issue is with this package or with Laravel-backup from spatie.

I will appreciate any idea to fix this problem.
thanks.

image

Possible bug : undefined Backup::size()

Hello,
I installed the package with fresh Laravel 8.12, so I'm getting this error :
Call to undefined method Spatie\Backup\BackupDestination\Backup::size()
NB: the backup passes successfully but in the panel that error appears.

Gate not working when also using spatie/laravel-permission

There is a conflict when using spatie/laravel-permission alongside the Laravel Backup Panel production gate.

Production gate works as expected on an app that doesn't use laravel-permission.

I've tested on two separate apps using laravel-permission, and it always denies you, even when your email matches.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.