Skip to content
Merged

4.x #40

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Code style

on:
push:
paths:
- '**.php'

permissions:
contents: write

jobs:
php-code-styling:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Check code style
uses: aglipanci/laravel-pint-action@v2

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply code style rules
7 changes: 3 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ jobs:
- { laravel: '11.*', php: '8.4', 'testbench': '9.*', collision: '8.*'}
- { laravel: '11.*', php: '8.3', 'testbench': '9.*', collision: '8.*'}
- { laravel: '11.*', php: '8.2', 'testbench': '9.*', collision: '8.*'}
- { laravel: '10.*', php: '8.4', 'testbench': '8.*', collision: '7.*'}
- { laravel: '10.*', php: '8.3', 'testbench': '8.*', collision: '7.*'}
- { laravel: '10.*', php: '8.2', 'testbench': '8.*', collision: '7.*'}
- { laravel: '10.*', php: '8.1', 'testbench': '8.*', collision: '7.*'}
- { laravel: '12.*', php: '8.4', 'testbench': '10.*', collision: '8.*'}
- { laravel: '12.*', php: '8.3', 'testbench': '10.*', collision: '8.*'}
- { laravel: '12.*', php: '8.2', 'testbench': '10.*', collision: '8.*'}

name: PHP ${{ matrix.payload.php }} - Laravel ${{ matrix.payload.laravel }}

Expand Down
61 changes: 1 addition & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The package will pick up on the scheduled settings and ping OhDear after the com

# Requirements

This package requires Laravel 10 or 11.
This package requires Laravel 11 or 12.

# Installation

Expand Down Expand Up @@ -128,9 +128,6 @@ public function boot()

To circumvent this, please add the following to `bootstrap/app.php`

<details>
<summary>Laravel 11</summary>

```php
<?php

Expand All @@ -156,42 +153,11 @@ return Application::configure(basePath: dirname(__DIR__))
})->create();

```
</details>

<details>
<summary>Laravel 10</summary>

```php
<?php

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/

$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

+ if (($_SERVER['REQUEST_URI'] ?? '') === '/cloud-scheduler-job') {
+ $_ENV['APP_RUNNING_IN_CONSOLE'] = true;
+ }
```
</details>

6 - Optional: whitelist route for maintenance mode

If you want to allow jobs to keep running if the application is down (`php artisan down`), update the following:

<details>
<summary>Laravel 11</summary>

```php
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
Expand All @@ -212,31 +178,6 @@ return Application::configure(basePath: dirname(__DIR__))


```
</details>
<details>
<summary>Laravel 10</summary>

```php
<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;

class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
*/
protected $except = [
+ '/cloud-scheduler-job',
];
}

```
</details>

# Cloud Scheduler Example

Expand Down
14 changes: 6 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
],
"require": {
"ext-json": "*",
"google/cloud-scheduler": "^1.6",
"phpseclib/phpseclib": "^3.0",
"google/cloud-scheduler": "^2.0",
"google/auth": "^v1.29.1",
"laravel/framework": "^10.0|^11.0",
"php": "^8.1",
"symfony/cache": "^6.4"
"laravel/framework": "^11.0|^12.0",
"symfony/cache": "^7.2",
"phpseclib/phpseclib": "^3.0"
},
"require-dev": {
"mockery/mockery": "^1.5",
"orchestra/testbench": "^8.0|^9.0",
"nunomaduro/collision": "^7.0|^8.0",
"orchestra/testbench": "^9.0|^10.0",
"nunomaduro/collision": "^8.0",
"laravel/pint": "^1.14"
},
"autoload": {
Expand Down
Loading
Loading