Skip to content

Commit 8b2be4c

Browse files
authored
feat: add support for Laravel 11 (#445)
* feat: add support for Laravel 11 * docs: update documentation for Laravel 11 * chore(ci): bump PHP versions used in test to 8.2+ * chore(gh): update bug report template with new versions * docs: update with support for Laravel 11
1 parent 5e33ee9 commit 8b2be4c

23 files changed

+233
-223
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ body:
4343
label: SDK Version
4444
description: What version of our SDK are you using? (`composer show | grep auth0/login`)
4545
options:
46+
- 7.13
4647
- 7.12
4748
- 7.11
4849
- 7.10
@@ -68,7 +69,6 @@ body:
6869
options:
6970
- PHP 8.3
7071
- PHP 8.2
71-
- PHP 8.1
7272
- Other (specify below)
7373
validations:
7474
required: true

.github/workflows/matrix.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"include": [
3-
{ "php": "8.1" },
4-
{ "php": "8.2" }
3+
{ "php": "8.2" },
4+
{ "php": "8.3" }
55
]
66
}

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ jobs:
118118
php: ${{ matrix.php }}
119119
coverage: pcov
120120

121-
- if: matrix.php == '8.1'
121+
- if: matrix.php == '8.2'
122122
run: composer pest:coverage
123123

124-
- if: matrix.php == '8.1'
124+
- if: matrix.php == '8.2'
125125
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # [email protected]
126126
with:
127127
directory: ./coverage/

README.md

+49-50
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,29 @@
1111

1212
**The Auth0 Laravel SDK is a PHP package that integrates [Auth0](https://auth0.com) into your Laravel application.** It includes no-code user authentication, extensive Management API support, permissions-based routing access control, and more.
1313

14-
- [Requirements](#requirements)
15-
- [Getting Started](#getting-started)
16-
- [1. Install the SDK](#1-install-the-sdk)
17-
- [2. Install the CLI](#2-install-the-cli)
18-
- [3. Configure the SDK](#3-configure-the-sdk)
19-
- [4. Run the Application](#4-run-the-application)
20-
- [Documentation](#documentation)
21-
- [QuickStarts](#quickstarts)
22-
- [Contributing](#contributing)
23-
- [Code of Conduct](#code-of-conduct)
24-
- [Security](#security)
25-
- [License](#license)
14+
- [Requirements](#requirements)
15+
- [Getting Started](#getting-started)
16+
- [1. Install the SDK](#1-install-the-sdk)
17+
- [2. Install the CLI](#2-install-the-cli)
18+
- [3. Configure the SDK](#3-configure-the-sdk)
19+
- [4. Run the Application](#4-run-the-application)
20+
- [Documentation](#documentation)
21+
- [QuickStarts](#quickstarts)
22+
- [Contributing](#contributing)
23+
- [Code of Conduct](#code-of-conduct)
24+
- [Security](#security)
25+
- [License](#license)
2626

2727
## Requirements
2828

29-
Your application must use a [supported Laravel version](https://laravelversions.com/en), and your host environment must be running a [supported PHP version](https://www.php.net/supported-versions.php). Please review [our support policy](./docs/Support.md) for more information.
29+
Your application must use the [latest supported Laravel version](https://endoflife.date/laravel), and your host environment must be running a [supported PHP version](https://www.php.net/supported-versions.php). Please review [our support policy](./docs/Support.md) for more information.
3030

31-
| SDK | Laravel | PHP | Supported Until |
32-
| ---- | ---------------------------------------------- | ----------------------------------------------- | --------------- |
33-
| 7.5+ | [10.x](https://laravel.com/docs/10.x/releases) | [8.3](https://www.php.net/releases/8.2/en.php) | Feb 2025 |
34-
| | | [8.2](https://www.php.net/releases/8.1/en.php) | Feb 2025 |
35-
| | | [8.1](https://www.php.net/releases/8.1/en.php) | Nov 2024 |
36-
| 7.0+ | [9.x](https://laravel.com/docs/9.x/releases) | [8.2](https://www.php.net/releases/8.2/en.php) | Feb 2024 |
37-
| | | [8.1](https://www.php.net/releases/8.1/en.php) | Feb 2024 |
31+
| SDK | Laravel | PHP | Supported Until |
32+
| ----- | ---------------------------------------------- | ---------------------------------------------- | --------------- |
33+
| 7.13+ | [11.x](https://laravel.com/docs/11.x/releases) | [8.3](https://www.php.net/releases/8.3/en.php) | ~Sep 2025 |
34+
| | | [8.2](https://www.php.net/releases/8.2/en.php) | ~Sep 2025 |
35+
36+
Due to breaking changes in Laravel 11, SDK 7.12 was the last version to support Laravel 9 and 10.
3837

3938
You will also need [Composer](https://getcomposer.org/) and an [Auth0 account](https://auth0.com/signup).
4039

@@ -44,16 +43,16 @@ The following is our recommended approach to getting started with the SDK. Alter
4443

4544
### 1. Install the SDK
4645

47-
- For **new applications**, we offer a quickstart template — a version of the default Laravel 9 starter project pre-configured for use with the Auth0 SDK.
46+
- For **new applications**, we offer a quickstart template — a version of the default Laravel 9 starter project pre-configured for use with the Auth0 SDK.
4847

4948
```shell
5049
composer create-project auth0-samples/laravel auth0-laravel-app && cd auth0-laravel-app
5150
```
5251

53-
- For **existing applications**, you can install the SDK using Composer.
52+
- For **existing applications**, you can install the SDK using Composer.
5453

5554
```shell
56-
composer require auth0/login:^7.9 --update-with-all-dependencies
55+
composer require auth0/login:^7 --update-with-all-dependencies
5756
```
5857

5958
In this case, you will also need to generate an SDK configuration file for your application.
@@ -170,21 +169,21 @@ php artisan serve
170169
171170
Direct your browser to [http://localhost:8000](http://localhost:8000) to experiment with the application.
172171
173-
- **Authentication**
174-
Users can log in or out of the application by visiting the [`/login`](http://localhost:8000/login) or [`/logout`](http://localhost:8000/logout) routes, respectively.
172+
- **Authentication**
173+
Users can log in or out of the application by visiting the [`/login`](http://localhost:8000/login) or [`/logout`](http://localhost:8000/logout) routes, respectively.
175174
176-
- **API Authorization**
177-
For simplicity sake, generate a test token using the CLI.
175+
- **API Authorization**
176+
For simplicity sake, generate a test token using the CLI.
178177
179178
```shell
180179
auth0 test token \
181180
--audience %IDENTIFIER% \
182181
--scopes "read:messages"
183182
```
184183
185-
<p><small>✋ <em>Substitute <code>%IDENTIFIER%</code> with the identifier of the API you created in step 3 above.</small></em></p>
184+
<p><small>✋ <em>Substitute <code>%IDENTIFIER%</code> with the identifier of the API you created in step 3 above.</small></em></p>
186185
187-
Now you can send requests to the `/api` endpoints of the application, including the token as a header.
186+
Now you can send requests to the `/api` endpoints of the application, including the token as a header.
188187
189188
```shell
190189
curl --request GET \
@@ -193,18 +192,18 @@ Direct your browser to [http://localhost:8000](http://localhost:8000) to experim
193192
--header 'Authorization: Bearer %TOKEN%'
194193
```
195194
196-
<p><small>✋ <em>Substitute <code>%TOKEN%</code> with the test token returned in the previous step.</small></em></p>
195+
<p><small>✋ <em>Substitute <code>%TOKEN%</code> with the test token returned in the previous step.</small></em></p>
197196
198-
<details>
199-
<summary>Using Windows PowerShell</summary>
200-
197+
<details>
198+
<summary>Using Windows PowerShell</summary>
199+
201200
202201
```powershell
203202
Invoke-WebRequest http://localhost:8000/api/example `
204203
-Headers @{'Accept' = 'application/json'; 'Authorization' = 'Bearer %TOKEN%'}
205204
```
206205
207-
</details>
206+
</details>
208207
209208
When you're ready to deploy your application to production, review [our deployment guide](./docs/Deployment.md) for best practices and advice on securing Laravel.
210209
@@ -354,33 +353,33 @@ All the SDK's Management API methods are [documented here](./docs/Management.md)
354353
355354
## Documentation
356355
357-
- [Installation](./docs/Installation.md) — Installing the SDK and generating configuration files.
358-
- [Configuration](./docs/Configuration.md) — Configuring the SDK using JSON files or environment variables.
359-
- [Sessions](./docs/Sessions.md) — Guidance on deciding which Laravel Session API driver to use.
360-
- [Cookies](./docs/Cookies.md) — Important notes about using Laravel's Cookie session driver, and alternative options.
361-
- [Management API](./docs/Management.md) — Using the SDK to work with the [Auth0 Management API](https://auth0.com/docs/api/management/v2).
362-
- [Users](./docs/Users.md) — Extending the SDK to support persistent storage and [Eloquent](https://laravel.com/docs/eloquent) models.
363-
- [Events](./docs/Events.md) — Hooking into SDK [events](https://laravel.com/docs/events) to respond to specific actions.
364-
- [Deployment](./docs/Deployment.md) — Deploying your application to production.
356+
- [Installation](./docs/Installation.md) — Installing the SDK and generating configuration files.
357+
- [Configuration](./docs/Configuration.md) — Configuring the SDK using JSON files or environment variables.
358+
- [Sessions](./docs/Sessions.md) — Guidance on deciding which Laravel Session API driver to use.
359+
- [Cookies](./docs/Cookies.md) — Important notes about using Laravel's Cookie session driver, and alternative options.
360+
- [Management API](./docs/Management.md) — Using the SDK to work with the [Auth0 Management API](https://auth0.com/docs/api/management/v2).
361+
- [Users](./docs/Users.md) — Extending the SDK to support persistent storage and [Eloquent](https://laravel.com/docs/eloquent) models.
362+
- [Events](./docs/Events.md) — Hooking into SDK [events](https://laravel.com/docs/events) to respond to specific actions.
363+
- [Deployment](./docs/Deployment.md) — Deploying your application to production.
365364
366365
You may find the following integration guidance useful:
367366
368-
- [Laravel Eloquent](./docs/Eloquent.md) — [Eloquent ORM](https://laravel.com/docs/eloquent) is supported.
369-
- [Laravel Octane](./docs/Octane.md) — [Octane](https://laravel.com/docs/octane) is not supported at this time.
370-
- [Laravel Telescope](./docs/Telescope.md) — [Telescope](https://laravel.com/docs/telescope) is compatible as of SDK v7.11.0.
367+
- [Laravel Eloquent](./docs/Eloquent.md) — [Eloquent ORM](https://laravel.com/docs/eloquent) is supported.
368+
- [Laravel Octane](./docs/Octane.md) — [Octane](https://laravel.com/docs/octane) is not supported at this time.
369+
- [Laravel Telescope](./docs/Telescope.md) — [Telescope](https://laravel.com/docs/telescope) is compatible as of SDK v7.11.0.
371370
372371
You may also find the following resources helpful:
373372
374-
- [Auth0 Documentation Hub](https://www.auth0.com/docs)
375-
- [Auth0 Management API Explorer](https://auth0.com/docs/api/management/v2)
376-
- [Auth0 Authentication API Explorer](https://auth0.com/docs/api/authentication)
373+
- [Auth0 Documentation Hub](https://www.auth0.com/docs)
374+
- [Auth0 Management API Explorer](https://auth0.com/docs/api/management/v2)
375+
- [Auth0 Authentication API Explorer](https://auth0.com/docs/api/authentication)
377376
378377
Contributions to improve our documentation [are welcomed](https://github.com/auth0/laravel-auth0/pull).
379378
380379
## QuickStarts
381380
382-
- [Session-based Authentication](https://auth0.com/docs/quickstart/webapp/laravel) ([GitHub](https://github.com/auth0-samples/laravel))
383-
- [Token-based Authorization](https://auth0.com/docs/quickstart/backend/laravel) ([GitHub](https://github.com/auth0-samples/laravel))
381+
- [Session-based Authentication](https://auth0.com/docs/quickstart/webapp/laravel) ([GitHub](https://github.com/auth0-samples/laravel))
382+
- [Token-based Authorization](https://auth0.com/docs/quickstart/backend/laravel) ([GitHub](https://github.com/auth0-samples/laravel))
384383
385384
## Community
386385

composer.json

+17-11
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,37 @@
3434
"forum": "https://community.auth0.com",
3535
"source": "https://github.com/auth0/laravel-auth0"
3636
},
37+
"repositories": [
38+
{
39+
"type": "vcs",
40+
"url": "https://github.com/asbiin/psalm-plugin-laravel.git"
41+
}
42+
],
3743
"require": {
38-
"php": "^8.1",
44+
"php": "^8.2",
3945
"ext-json": "*",
4046
"auth0/auth0-php": "^8.10",
41-
"illuminate/contracts": "^9 || ^10",
42-
"illuminate/http": "^9 || ^10",
43-
"illuminate/support": "^9 || ^10",
47+
"illuminate/contracts": "^11",
48+
"illuminate/http": "^11",
49+
"illuminate/support": "^11",
4450
"psr-discovery/all": "^1",
4551
"psr/cache": "^2 || ^3"
4652
},
4753
"require-dev": {
4854
"ergebnis/composer-normalize": "^2",
4955
"friendsofphp/php-cs-fixer": "^3",
56+
"larastan/larastan": "^2",
5057
"mockery/mockery": "^1",
51-
"nunomaduro/larastan": "^2",
52-
"orchestra/testbench": "^7 || ^8",
53-
"pestphp/pest": "^2",
58+
"orchestra/testbench": "^9.x-dev",
5459
"pestphp/pest-plugin-laravel": "^2",
55-
"phpstan/phpstan": "^1",
60+
"pestphp/pest": "^2",
5661
"phpstan/phpstan-strict-rules": "^1",
57-
"psalm/plugin-laravel": "^2",
62+
"phpstan/phpstan": "^1",
63+
"psalm/plugin-laravel": "dev-laravel11#b93c8f21c18e3355dcdae797c6af266f7aab93f6",
5864
"psr-mock/http": "^1",
59-
"rector/rector": "0.17.0",
65+
"rector/rector": "^1",
6066
"squizlabs/php_codesniffer": "^3",
61-
"symfony/cache": "^6",
67+
"symfony/cache": "^6 || ^7",
6268
"vimeo/psalm": "^5",
6369
"wikimedia/composer-merge-plugin": "^2"
6470
},

deprecated/Model/User.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Auth0\Laravel\Model;
66

7-
use Auth0\Laravel\Users\{UserAbstract, UserContract};
7+
use Auth0\Laravel\Users\UserAbstract;
88

99
/**
1010
* @deprecated 7.8.0 Use Auth0\Laravel\Users\UserAbstract instead.

docs/Deployment.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
When you're preparing to deploy your application to production, there are some basic steps you can take to make sure your application is running as smoothly and securely as possible. In this guide, we'll cover some starting points for making sure your application is deployed properly.
44

5-
- [Auth0 Configuration](#auth0-configuration)
6-
- [TLS / HTTPS](#tls--https)
7-
- [Cookies](#cookies)
8-
- [Server Configuration](#server-configuration)
9-
- [Caddy](#caddy)
10-
- [Nginx](#nginx)
11-
- [Apache](#apache)
12-
- [Optimization](#optimization)
13-
- [Autoloader](#autoloader)
14-
- [Dependencies](#dependencies)
15-
- [Caching Configuration](#caching-configuration)
16-
- [Caching Events](#caching-events)
17-
- [Caching Routes](#caching-routes)
18-
- [Caching Views](#caching-views)
19-
- [Debug Mode](#debug-mode)
5+
- [Auth0 Configuration](#auth0-configuration)
6+
- [TLS / HTTPS](#tls--https)
7+
- [Cookies](#cookies)
8+
- [Server Configuration](#server-configuration)
9+
- [Caddy](#caddy)
10+
- [Nginx](#nginx)
11+
- [Apache](#apache)
12+
- [Optimization](#optimization)
13+
- [Autoloader](#autoloader)
14+
- [Dependencies](#dependencies)
15+
- [Caching Configuration](#caching-configuration)
16+
- [Caching Events](#caching-events)
17+
- [Caching Routes](#caching-routes)
18+
- [Caching Views](#caching-views)
19+
- [Debug Mode](#debug-mode)
2020

2121
## Auth0 Configuration
2222

2323
When migrating your Laravel application from local development to production, you will need to update your Auth0 application's configuration to reflect the new URLs for your application. You can do this by logging into the [Auth0 Dashboard](https://manage.auth0.com/) and updating the following fields:
2424

25-
- **Allowed Callback URLs**: The URL that Auth0 will redirect to after the user authenticates. This should be set to the Internet-accessible URL of your application's `/callback` route.
26-
- **Allowed Logout URLs**: The URL that Auth0 will redirect to after the user logs out. This should be set to an appropriate Internet-accessible URL of your application.
25+
- **Allowed Callback URLs**: The URL that Auth0 will redirect to after the user authenticates. This should be set to the Internet-accessible URL of your application's `/callback` route.
26+
- **Allowed Logout URLs**: The URL that Auth0 will redirect to after the user logs out. This should be set to an appropriate Internet-accessible URL of your application.
2727

2828
Note that you can include multiple URLs in these fields by separating them with commas, for example `https://example.com/callback,http://localhost:8000/callback`.
2929

@@ -64,7 +64,7 @@ example.com {
6464
X-Frame-Options "SAMEORIGIN"
6565
}
6666
67-
php_fastcgi unix//var/run/php/php8.1-fpm.sock
67+
php_fastcgi unix//var/run/php/php8.2-fpm.sock
6868
}
6969
```
7070

@@ -76,32 +76,32 @@ server {
7676
listen [::]:80;
7777
server_name example.com;
7878
root /var/www/example.com/public;
79-
79+
8080
add_header X-XSS-Protection "1; mode=block";
8181
add_header X-Content-Type-Options "nosniff";
8282
add_header X-Frame-Options "SAMEORIGIN";
8383
8484
large_client_header_buffers 4 32k;
85-
85+
8686
index index.php;
87-
87+
8888
charset utf-8;
89-
89+
9090
location / {
9191
try_files $uri $uri/ /index.php?$query_string;
9292
}
93-
93+
9494
location = /favicon.ico { access_log off; log_not_found off; }
9595
location = /robots.txt { access_log off; log_not_found off; }
96-
96+
9797
error_page 404 /index.php;
98-
98+
9999
location ~ \.php$ {
100-
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
100+
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
101101
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
102102
include fastcgi_params;
103103
}
104-
104+
105105
location ~ /\.(?!well-known).* {
106106
deny all;
107107
}

0 commit comments

Comments
 (0)