File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 9999 LaravelReady \LicenseServer \Http \Controllers \Api \LicenseValidateController::class,
100100 'licenseValidate '
101101 ]
102- ]
102+ ],
103+
104+ /**
105+ * Addional middlewares for license validation routes
106+ *
107+ * Package middlewares will be run before this middlewares.
108+ *
109+ * Default: []
110+ */
111+ 'license_middlewares ' => []
103112];
Original file line number Diff line number Diff line change 2929 ? $ licenseController
3030 : [LicenseValidationController::class, 'licenseValidate ' ];
3131
32- Route:: middleware ( [
32+ $ licenseMiddlewares = [
3333 'auth:sanctum ' ,
3434 'ls-license-guard ' ,
35- ])->post ('license ' , $ licenseController );
35+ ];
36+
37+ $ addionalMiddlewares = Config::get ('license-server.license_middlewares ' , []);
38+
39+ if ($ addionalMiddlewares && count ($ addionalMiddlewares )) {
40+ $ licenseMiddlewares = array_merge ($ licenseMiddlewares , $ addionalMiddlewares );
41+ }
42+
43+ Route::middleware ($ licenseMiddlewares )->post ('license ' , $ licenseController );
3644 });
You can’t perform that action at this time.
0 commit comments