Skip to content

Commit 60193fb

Browse files
Update README.md
1 parent 16936b0 commit 60193fb

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,37 @@ STACKKIT_CLOUD_SCHEDULER_APP_URL=https://yourdomainname.com/cloud-scheduler-job
6969

7070
(3) Optional: whitelist route for maintenance mode
7171

72-
This step is optional, but highly recommended. To allow jobs to keep running if the application is down (`php artisan down`) you must modify the `PreventRequestsDuringMaintenance` middleware:
7372

74-
```diff
73+
If you want to allow jobs to keep running if the application is down (`php artisan down`), update the following:
74+
75+
<details>
76+
<summary>Laravel 11</summary>
77+
78+
```php
79+
return Application::configure(basePath: dirname(__DIR__))
80+
->withRouting(
81+
web: __DIR__ . '/../routes/web.php',
82+
commands: __DIR__ . '/../routes/console.php',
83+
health: '/up',
84+
)
85+
->withMiddleware(function (Middleware $middleware) {
86+
$middleware->preventRequestsDuringMaintenance(
87+
except: [
88+
'/cloud-scheduler-job',
89+
],
90+
);
91+
})
92+
->withExceptions(function (Exceptions $exceptions) {
93+
//
94+
})->create();
95+
96+
97+
```
98+
</details>
99+
<details>
100+
<summary>Laravel 10</summary>
101+
102+
```php
75103
<?php
76104

77105
namespace App\Http\Middleware;
@@ -91,6 +119,7 @@ class PreventRequestsDuringMaintenance extends Middleware
91119
}
92120

93121
```
122+
</details>
94123

95124
(4) Optional: set application `RUNNING_IN_CONSOLE` (highly recommended)
96125

0 commit comments

Comments
 (0)