Skip to content

Commit e1545e1

Browse files
committed
Add support for Custom Middleware for Ajax calls
1 parent af8b598 commit e1545e1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/ServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function boot()
6161
$routeConfig = [
6262
'namespace' => 'Arrilot\Widgets\Controllers',
6363
'prefix' => 'arrilot',
64+
'middleware' => $this->app->config('laravel-widgets.route_middleware', [])
6465
];
6566

6667
if (!$this->app->routesAreCached()) {

src/config/config.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
'use_jquery_for_ajax_calls' => false,
77

8+
/*
9+
* Set Ajax widget middleware
10+
*/
11+
'route_middleware' => [],
12+
813
/*
914
* Relative path from the base directory to a regular widget stub.
1015
*/

0 commit comments

Comments
 (0)