Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Backup Laravel Package

spatie/laravel-backup

Spatie Laravel Backup creates zip backups of your app files and database, storing them on any Laravel filesystem (even multiple). Includes health monitoring, notifications, and automatic cleanup of old backups. Run with php artisan backup:run.

View on GitHub
Deep Wiki
Context7

title: Creating your custom health check weight: 2

You can create your own custom health check by letting a class extend Spatie\Backup\Tasks\Monitor\HealthCheck.

That base class contains one abstract method that you should implement.

public function checkHealth(BackupDestination $backupDestination);

If your check determines that the backup is not healthy it should throw a Spatie\Backup\Exceptions\InvalidHealthCheck exception. The HealthCheck base class contains three helpful methods that helps you do this.

  • fail($message): will throw the right exception under the hood.
  • failIf(bool $condition, string $message): will throw the right exception if $condition is true
  • failUnless(bool $condition, string $message): will throw the right exception if $condition is false

You should register your custom health check in the health_checks key of the backup.php config file.

To see an example of a HealthCheck, go read the could of the MaximumAgeInDays and MaximumStorageInMegabytes health checks that are provided by the package.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
datacore/hub-sdk
alengo/sulu-http-cache-bundle
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php
trappistes/laravel-custom-fields
splash/sonata-admin
splash/metadata