diff --git a/app/Http/Middleware/PreventBackHistory.php b/app/Http/Middleware/PreventBackHistory.php new file mode 100644 index 0000000..e5b141b --- /dev/null +++ b/app/Http/Middleware/PreventBackHistory.php @@ -0,0 +1,24 @@ +header('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate') + ->header('Pragma', 'no-cache') + ->header('Expires', 'Fri, 01 Jan 1990 00:00:00 GMT'); + } +} diff --git a/routes/web.php b/routes/web.php index 85868fb..68a35bf 100644 --- a/routes/web.php +++ b/routes/web.php @@ -50,7 +50,7 @@ |-------------------------------------------------------------------------- | */ -Route::prefix('admin')->name('admin.')->middleware(['auth'])->group(function () { +Route::prefix('admin')->name('admin.')->middleware(['auth', 'prevent-back'])->group(function () { Route::redirect('/', '/admin/beranda');