Skip to content

Commit f9ddf13

Browse files
authored
Merge pull request #45 from sakalauskas/master
Add support for Custom Middleware for Ajax calls
2 parents af8b598 + cdeeecd commit f9ddf13

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/ServiceProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ public function boot()
5959
]);
6060

6161
$routeConfig = [
62-
'namespace' => 'Arrilot\Widgets\Controllers',
63-
'prefix' => 'arrilot',
62+
'namespace' => 'Arrilot\Widgets\Controllers',
63+
'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)