Skip to content

Commit

Permalink
Add get repository implementation fromm config
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoIsRecursive committed Jun 14, 2024
1 parent 6947440 commit 6432637
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions config/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
// 'time' => '03:00',
],

/**
* The backup repository
*/
'repository' => \Itiden\Backup\Repositories\FileBackupRepository::class,

/**
* The backup steps to use
*
Expand Down
11 changes: 6 additions & 5 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Itiden\Backup\Console\Commands\BackupCommand;
use Itiden\Backup\Console\Commands\ClearFilesCommand;
use Itiden\Backup\Console\Commands\RestoreCommand;
use Itiden\Backup\Contracts\Repositories\BackupRepository;
use Statamic\Facades\CP\Nav;
use Statamic\Facades\Permission;
use Statamic\Providers\AddonServiceProvider;
Expand Down Expand Up @@ -63,15 +64,15 @@ protected function schedule(Schedule $schedule)

public function register()
{
$this->app->bind(
\Itiden\Backup\Contracts\Repositories\BackupRepository::class,
\Itiden\Backup\Repositories\FileBackupRepository::class
);

$this->mergeConfigFrom(
__DIR__ . '/../config/backup.php',
'backup'
);

$this->app->bind(
BackupRepository::class,
config('backup.repository')
);
}

private function setUpPermissions()
Expand Down

0 comments on commit 6432637

Please sign in to comment.