Total Complexity | 6 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class BackupController extends Controller |
||
12 | { |
||
13 | // Only authorized users have access |
||
14 | public function __construct() |
||
15 | { |
||
16 | $this->middleware('auth'); |
||
17 | } |
||
18 | |||
19 | // Backup landing page |
||
20 | public function index() |
||
21 | { |
||
22 | return view('installer.backupIndex'); |
||
23 | } |
||
24 | |||
25 | public function loadBackups() |
||
26 | { |
||
27 | $backups = Storage::disk('backup')->files(); |
||
28 | |||
29 | return view('installer.backupShow', [ |
||
30 | 'backups' => $backups |
||
31 | ]); |
||
32 | } |
||
33 | |||
34 | // Manual backup |
||
35 | public function backupNow() |
||
36 | { |
||
37 | Artisan::call('backup:now', [ |
||
38 | 'type' => 'manual' |
||
39 | ]); |
||
40 | |||
41 | return 'success'; |
||
42 | } |
||
43 | |||
44 | // Download an existing backup |
||
45 | public function downloadBackup($name) |
||
48 | } |
||
49 | |||
50 | // Delete a backup |
||
51 | public function deleteBackup($name) |
||
55 | } |
||
56 | } |
||
57 |