Coder Social home page Coder Social logo

filament-spatie-laravel-backup's Introduction

Filament Spatie Laravel Backup

PHP Version Require Build Status Latest Stable Version Total Downloads License

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.

Screenshot 2023-08-05 at 2 42 10 PM

Support For This Project

Buy Me A Coffee

Installation

You can install the package via composer:

composer require shuvroroy/filament-spatie-laravel-backup

Publish the package's assets:

php artisan filament:assets

You can publish the lang file with:

php artisan vendor:publish --tag="filament-spatie-backup-translations"

Usage

You first need to register the plugin with Filament. This can be done inside of your PanelProvider, e.g. AdminPanelProvider.

<?php

namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use ShuvroRoy\FilamentSpatieLaravelBackup\FilamentSpatieLaravelBackupPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(FilamentSpatieLaravelBackupPlugin::make());
    }
}

If you want to override the default HealthCheckResults page icon, heading then you can extend the page class and override the navigationIcon property and getHeading method and so on.

<?php

namespace App\Filament\Pages;

use ShuvroRoy\FilamentSpatieLaravelBackup\Pages\Backups as BaseBackups;

class Backups extends BaseBackups
{
    protected static ?string $navigationIcon = 'heroicon-o-cpu-chip';

    public function getHeading(): string | Htmlable
    {
        return 'Application Backups';
    }

    public static function getNavigationGroup(): ?string
    {
        return 'Core';
    }
}

Then register the extended page class on AdminPanelProvider class.

<?php

namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use App\Filament\Pages\Backups;
use ShuvroRoy\FilamentSpatieLaravelBackup\FilamentSpatieLaravelBackupPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(
                FilamentSpatieLaravelBackupPlugin::make()
                    ->usingPage(Backups::class)
            );
    }
}

Customising the polling interval

You can customise the polling interval for the Backups by following the steps below:

<?php

namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use ShuvroRoy\FilamentSpatieLaravelBackup\FilamentSpatieLaravelBackupPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(
                FilamentSpatieLaravelBackupPlugin::make()
                    ->usingPolingInterval('10s') // default value is 4s
            );
    }
}

Customising the queue

You can customise the queue name for the Backups by following the steps below:

<?php

namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use ShuvroRoy\FilamentSpatieLaravelBackup\FilamentSpatieLaravelBackupPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(
                FilamentSpatieLaravelBackupPlugin::make()
                    ->usingQueue('my-queue') // default value is null
            );
    }
}

Upgrading

Please see UPGRADE for details on how to upgrade 1.X to 2.0.

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

filament-spatie-laravel-backup's People

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

filament-spatie-laravel-backup's Issues

Restore

How can I restore the backup?

Notify when user does not have mysqldump

So i was trying the package, but when i click backup only database, it wont work. turns out, when i debug, it has an error:

image

Maybe it would be nice to have some notification to check the condition before running the backup queue after response.

could not find driver

This error occurs when I want to see the backup table in Filament php V3.

Illuminate \ Database \ QueryException
PHP 8.1.10
Laravel 10.48.3

could not find driver

create table "backup_destination_statuses" (
"id" integer primary key autoincrement not null,
"name" varchar,
"disk" varchar,
"reachable" varchar,
"healthy" varchar,
"amount" integer,
"newest" varchar,
"usedStorage" varchar
)

Does anyone know how to resolve this bug?

JS error when creating a backup

After clicking a button to generate a backup, I would expect the modal to close and the job to be queued.

However, what's happening is the modal stays open and nothing happens. Job doesn't get queued and the modal does not close.

Fresh install of spatie-backup and filament-spatie-backup, with default configs. Running the spatie backup command manually in the console works correctly.
Screenshot 2022-07-04 053949

Package doesn't seem to work

I've installed this package and it doesn't seem to work.

Clicking "Create Backup" gives me the popup/modal to pick the type of backup I want to make, but when selecting a backup, even though it tells me that a backup is being done in the background, nothing seems to happen.

Using the default spatie backup artisan commands, I can take a backup and then doing a "php artisan backup:list" shows me the new backup but the filament plugin does not show this backup.

As such, it would seem that something fundamental is wrong here. Please advise.

How to set 'backup.pages.backups.navigation.group'

Hi apologies for raising a total noob question, but how do I set the:

backup.pages.backups.navigation.group

I see the class make provision for it. I have publish the config but the config is sparse and I only see this:

return [
...
    'pages' => [
        'backups' => \ShuvroRoy\FilamentSpatieLaravelBackup\Pages\Backups::class
    ],
...
    'polling' => [
        'interval' => '4s'
    ],
...
    'queue' => null,

];

I presume it's something fundamental about Filamentphp that I don't understand but I don't know where to start.

I tried raising this problem in GitHub Q&A for this repo but the hyperlink says 404.

[Question] Laravel Backup

Is your code backward compatibility to laravel backup v6? I think laravel backup v6 is the only compatible to windows since it don't use SIGNAL.

could not find driver

Hey,
I'm using your plugin for backup and using PostgresSQL with Laragon on Windows and latest filament I get error of "could not find driver" when I open Backups page.

Policies?

How are you applying policies as to who can access this when the plugin doesn't use a model persay?

Undefined constant "Spatie\Backup\Tasks\Backup\SIGINT"

When clicking on "Create Backup" and then on "only DB" (or any other option) it runs endless. In laravel.log I get Undefined constant "Spatie\Backup\Tasks\Backup\SIGINT"?

Running spatie backup from commandline php artisan backup:run works without any problems.

No Create Backup button

Installed this and spatie packages and backups are working from the php artisan commands. They are listed in the Filament UI but there is no Create Backup botton shown, nor can backups be downloaded / deleted.

could not find driver exception

any idea why i get

Illuminate\Database\QueryException
could not find driver

create table "backup_destination_statuses" ("id" integer not null primary key autoincrement, "name" varchar, "disk" varchar, "reachable" varchar, "healthy" varchar, "amount" integer, "newest" varchar, "usedStorage" varchar)

every time i try to go to the backups page ?

Change the destination disk

I don't know exactly how to change the destination disk of the backup.
I tried to follow the Spatie instructions but in the filament-*.php file and I just only success to change the "name".

Thanks in advance.

could not find driver

Hi,

I don't know if this is a bug or me doing something wrong: after installing the package, I see the Backup item on the menu and when I try it, I get the following error:

Illuminate  Database QueryException
could not find driver
create table "backup_destination_statuses" ("id" integer not null primary key autoincrement, "name" varchar, "disk" varchar, "reachable" varchar, "healthy" varchar, "amount" integer, "newest" varchar, "usedStorage" varchar)

The Spatie package was installed and running before I installed filament-spatie-laravel-backup, and is still working fine from the command line.

All configs are default.

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.