-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathroutes.php
More file actions
22 lines (21 loc) · 805 Bytes
/
routes.php
File metadata and controls
22 lines (21 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
use Webula\SmallBackup\Models\Settings;
Route::get(config('webula.smallbackup::trigger.url_prefix') . '{trigger_key}', function (string $trigger_key) {
if (Settings::get('has_trigger') && hash_equals(Settings::get('trigger_key'), $trigger_key)) {
if (Settings::get('db_mode') == 'trigger') {
// wsb_backup_db();
Artisan::call('smallbackup:db');
}
if (Settings::get('theme_mode') == 'trigger') {
// wsb_backup_theme();
Artisan::call('smallbackup:theme');
}
if (Settings::get('storage_mode') == 'trigger') {
// wsb_backup_storage();
Artisan::call('smallbackup:storage');
}
response()->noContent()->setStatusCode(200)->send();
} else {
abort(403);
}
});