|
6 | 6 |
|
7 | 7 | use Illuminate\Console\Scheduling\Schedule; |
8 | 8 | use Illuminate\Support\Facades\Config; |
| 9 | +use Illuminate\Support\Facades\View; |
9 | 10 | use Itiden\Backup\Console\Commands\BackupCommand; |
10 | 11 | use Itiden\Backup\Console\Commands\ClearFilesCommand; |
11 | 12 | use Itiden\Backup\Console\Commands\RestoreCommand; |
|
17 | 18 | use Statamic\Facades\CP\Nav; |
18 | 19 | use Statamic\Facades\Permission; |
19 | 20 | use Statamic\Providers\AddonServiceProvider; |
| 21 | +use Statamic\Statamic; |
20 | 22 |
|
21 | 23 | final class ServiceProvider extends AddonServiceProvider |
22 | 24 | { |
@@ -48,6 +50,7 @@ public function bootAddon(): void |
48 | 50 | $this->configurePermissions(); |
49 | 51 | $this->configureNavigation(); |
50 | 52 | $this->configureCommands(); |
| 53 | + $this->configureViewVariables(); |
51 | 54 | } |
52 | 55 |
|
53 | 56 | public function schedule(Schedule $schedule): void |
@@ -78,6 +81,15 @@ private function configureCommands(): void |
78 | 81 | ]); |
79 | 82 | } |
80 | 83 |
|
| 84 | + private function configureViewVariables(): void |
| 85 | + { |
| 86 | + View::composer('statamic::layout', function ($view) { |
| 87 | + Statamic::provideToScript(['statamic_backup' => [ |
| 88 | + 'chunk_size' => config('backup.chunk_size'), |
| 89 | + ]]); |
| 90 | + }); |
| 91 | + } |
| 92 | + |
81 | 93 | private function configureNavigation(): void |
82 | 94 | { |
83 | 95 | Nav::extend(static function (Navigation $nav): void { |
|
0 commit comments