%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/vendor/spatie/laravel-backup/src/ |
Upload File : |
<?php
namespace Spatie\Backup;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Notification;
use Spatie\Backup\Commands\BackupCommand;
use Spatie\Backup\Commands\CleanupCommand;
use Spatie\Backup\Commands\ListCommand;
use Spatie\Backup\Commands\MonitorCommand;
use Spatie\Backup\Events\BackupZipWasCreated;
use Spatie\Backup\Helpers\ConsoleOutput;
use Spatie\Backup\Listeners\EncryptBackupArchive;
use Spatie\Backup\Notifications\Channels\Discord\DiscordChannel;
use Spatie\Backup\Notifications\EventHandler;
use Spatie\Backup\Tasks\Cleanup\CleanupStrategy;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
class BackupServiceProvider extends PackageServiceProvider
{
public function configurePackage(Package $package): void
{
$package
->name('laravel-backup')
->hasConfigFile()
->hasTranslations()
->hasCommands([
BackupCommand::class,
CleanupCommand::class,
ListCommand::class,
MonitorCommand::class,
]);
}
public function packageBooted()
{
if (EncryptBackupArchive::shouldEncrypt()) {
Event::listen(BackupZipWasCreated::class, EncryptBackupArchive::class);
}
}
public function packageRegistered()
{
$this->app['events']->subscribe(EventHandler::class);
$this->app->singleton(ConsoleOutput::class);
$this->app->bind(CleanupStrategy::class, config('backup.cleanup.strategy'));
$this->registerDiscordChannel();
}
protected function registerDiscordChannel()
{
Notification::resolved(function (ChannelManager $service) {
$service->extend('discord', function ($app) {
return new DiscordChannel();
});
});
}
}