Skip to content

Commit 9964d75

Browse files
committed
Allow middleware to be configurable through config
1 parent ad1c051 commit 9964d75

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

config/exponent-push-notifications.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
*/
88

99
return [
10+
'middleware' => [
11+
//'auth:sanctum', <- Only use this middleware if you're using Sanctum
12+
'auth:api',
13+
'bindings'
14+
],
1015
'debug' => env('EXPONENT_PUSH_NOTIFICATION_DEBUG', true),
1116

1217
'interests' => [

src/Http/routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
Route::group(['prefix' => 'api/exponent/devices', 'middleware' => ['auth:api', 'bindings']], function () {
3+
Route::group(['prefix' => 'api/exponent/devices', 'middleware' => config('middleware') ?? ['auth:api', 'bindings']], function () {
44
Route::post('subscribe', [
55
'as' => 'register-interest',
66
'uses' => 'NotificationChannels\ExpoPushNotifications\Http\ExpoController@subscribe',

0 commit comments

Comments
 (0)