Skip to content

Commit 9e41ea6

Browse files
committed
Remove backup create and clean routes from web.php; simplify BackupActions controller by eliminating related methods
1 parent 1569ab7 commit 9e41ea6

File tree

5 files changed

+12
-30
lines changed

5 files changed

+12
-30
lines changed

app/Http/Controllers/BackupActions.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace App\Http\Controllers;
44

5-
use Illuminate\Support\Facades\Artisan;
65
use Yaza\LaravelGoogleDriveStorage\Gdrive;
76

87
class BackupActions extends Controller
@@ -20,22 +19,4 @@ public function downloadBackup(string $filename)
2019
'Content-disposition' => 'attachment; filename="'.$filename.'"', // force download?
2120
]);
2221
}
23-
24-
public function cleanBackup()
25-
{
26-
dispatch(function () {
27-
Artisan::call('simpede:backup clean');
28-
})->name('Clean Backup');
29-
30-
return redirect()->back()->with('status', 'Backup cleaning processed in background.');
31-
}
32-
33-
public function createBackup()
34-
{
35-
dispatch(function () {
36-
Artisan::call('simpede:backup create');
37-
})->name('Create Backup');
38-
39-
return redirect()->back()->with('status', 'Backup creation processed in background.');
40-
}
4122
}

app/Nova/Dashboards/Main.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
namespace App\Nova\Dashboards;
44

55
use App\Helpers\Helper;
6-
use App\Nova\Metrics\Rapat;
7-
use App\Nova\Metrics\Deadline;
86
use App\Nova\Metrics\Kegiatan;
9-
use Laravelwebdev\Welcome\Welcome;
10-
use Laravelwebdev\NovaQuotes\NovaQuotes;
117
use Laravel\Nova\Dashboards\Main as Dashboard;
8+
use Laravelwebdev\NovaQuotes\NovaQuotes;
9+
use Richardkeep\NovaTimenow\NovaTimenow;
1210

1311
class Main extends Dashboard
1412
{
@@ -37,9 +35,16 @@ public function cards()
3735
NovaQuotes::make()
3836
->greetings(__('Welcome Back!'))
3937
->user(auth()->user()->name ?? 'Guest')
40-
->width('full')
38+
->width('2/3')
4139
->description('Role: '.implode(', ', $values))
4240
->render(),
41+
NovaTimenow::make()
42+
->width('1/3')
43+
->timezones([
44+
'Asia/Pontianak',
45+
'Asia/Makassar',
46+
'Asia/Jayapura',
47+
])->defaultTimezone(config('app.timezone')),
4348
Kegiatan::make('Deadline')
4449
->emptyText('Tidak ada deadline')
4550
->width('1/3'),

app/Nova/Metrics/BackupsTable.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ public function calculate(NovaRequest $request): array
5757
->subtitle('Created: '.$backup['date'].', Size: '.$backup['size'])
5858
->actions(fn () => [
5959
MenuItem::externalLink('Download', config('app.url').config('nova.path').'/backup/download'.basename($backup['path'])),
60-
MenuItem::externalLink('Create Backup', config('app.url').config('nova.path').'/backup/create'),
61-
MenuItem::externalLink('Clean Backup', config('app.url').config('nova.path').'/backup/clean'),
60+
6261
]);
6362
}
6463

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"pekhota/nova-scroll-buttons": "*",
4343
"phpoffice/phpword": "^1.2",
4444
"rap2hpoutre/fast-excel": "^5.5",
45+
"richardkeep/nova-timenow": "^3.0",
4546
"sentry/sentry-laravel": "*",
4647
"spatie/laravel-backup": "^9.3",
4748
"sweetalert2/laravel": "^0.1.0",

routes/web.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
->name('dump-download');
2121
Route::get('/backup/download/{filename}', [BackupActions::class, 'downloadBackup'])
2222
->name('backup-download');
23-
Route::get('/backup/clean', [BackupActions::class, 'cleanBackup'])
24-
->name('backup-clean');
25-
Route::get('/backup/create', [BackupActions::class, 'createBackup'])
26-
->name('backup-create');
2723
});
2824

2925
Route::middleware([ValidateAccessToken::class])

0 commit comments

Comments
 (0)