Skip to content

Commit b874a83

Browse files
committed
automatically apply middleware to 'web' group
1 parent 3646533 commit b874a83

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/NativeServiceProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Console\Application;
66
use Illuminate\Foundation\Application as Foundation;
7+
use Illuminate\Routing\Router;
78
use Illuminate\Support\Arr;
89
use Illuminate\Support\Facades\Artisan;
910
use Illuminate\Support\Facades\DB;
@@ -23,6 +24,7 @@
2324
use Native\Laravel\Events\EventWatcher;
2425
use Native\Laravel\Exceptions\Handler;
2526
use Native\Laravel\GlobalShortcut as GlobalShortcutImplementation;
27+
use Native\Laravel\Http\Middleware\PreventRegularBrowserAccess;
2628
use Native\Laravel\Logging\LogWatcher;
2729
use Native\Laravel\PowerMonitor as PowerMonitorImplementation;
2830
use Native\Laravel\Windows\WindowManager as WindowManagerImplementation;
@@ -84,6 +86,11 @@ public function packageRegistered()
8486
Handler::class
8587
);
8688

89+
// Automatically prevent browser access
90+
$this->app->make(Router::class)->pushMiddlewareToGroup('web', [
91+
PreventRegularBrowserAccess::class,
92+
]);
93+
8794
Application::starting(function ($app) {
8895
$app->resolveCommands([
8996
LoadStartupConfigurationCommand::class,

0 commit comments

Comments
 (0)