Skip to content

Commit 56d757d

Browse files
authored
Merge pull request #17 from worksome/feature/laravel-11
feat: add support for Laravel 11
2 parents 6a213d3 + 6ac76d2 commit 56d757d

File tree

7 files changed

+23
-17
lines changed

7 files changed

+23
-17
lines changed

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: PHPStan
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ jobs:
1515
fail-fast: true
1616
matrix:
1717
os: [ubuntu-latest]
18-
php: [8.2]
19-
laravel: ['10.*']
18+
php: [8.2, 8.3]
19+
laravel: [10.*, 11.*]
2020
stability: [prefer-lowest, prefer-stable]
2121
include:
2222
- laravel: 10.*
2323
testbench: 8.*
24+
- laravel: 11.*
25+
testbench: 9.*
2426

2527
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2628

2729
steps:
2830
- name: Checkout code
29-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
3032

3133
- name: Setup PHP
3234
uses: shivammathur/setup-php@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/worksome/laravel-mfa/Static%20Analysis?style=flat-square&label=code%20style)](https://github.com/worksome/laravel-mfa/actions?query=workflow%3A"Static+Analysis"+branch%3Amain)
66
[![Total Downloads](https://img.shields.io/packagist/dt/worksome/laravel-mfa.svg?style=flat-square)](https://packagist.org/packages/worksome/laravel-mfa)
77

8-
A driver-based multifactor authentication package for Laravel
8+
A driver-based multi-factor authentication package for Laravel
99

1010
## Installation
1111

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "worksome/laravel-mfa",
3-
"description": "A driver-based multifactor authentication package for Laravel",
3+
"description": "A driver-based multi-factor authentication package for Laravel",
44
"keywords": [
55
"worksome",
66
"laravel",
@@ -17,18 +17,18 @@
1717
],
1818
"require": {
1919
"php": "^8.2",
20-
"guzzlehttp/guzzle": "^7.5",
21-
"laravel/framework": "^10.0",
20+
"guzzlehttp/guzzle": "^7.8",
21+
"laravel/framework": "^10.0 || ^11.0",
2222
"pragmarx/google2fa": "^8.0",
23-
"spatie/laravel-package-tools": "^1.14.1"
23+
"spatie/laravel-package-tools": "^1.16"
2424
},
2525
"require-dev": {
26-
"nunomaduro/collision": "^7.0",
27-
"nunomaduro/larastan": "^2.4.0",
28-
"orchestra/testbench": "^8.0",
29-
"pestphp/pest": "^2.0",
30-
"pestphp/pest-plugin-laravel": "^2.0",
31-
"worksome/coding-style": "^2.5"
26+
"larastan/larastan": "^2.6",
27+
"nunomaduro/collision": "^7.0 || ^8.1",
28+
"orchestra/testbench": "^8.0 || ^9.0",
29+
"pestphp/pest": "^2.33",
30+
"pestphp/pest-plugin-laravel": "^2.2",
31+
"worksome/coding-style": "^2.10"
3232
},
3333
"autoload": {
3434
"psr-4": {

src/Casts/ToFieldCaster.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
88
use InvalidArgumentException;
99
use Worksome\MultiFactorAuth\DataValues\Email\EmailAddress;
10+
use Worksome\MultiFactorAuth\DataValues\Identifier;
1011
use Worksome\MultiFactorAuth\DataValues\Sms\E164PhoneNumber;
1112
use Worksome\MultiFactorAuth\DataValues\Totp\TotpSecret;
1213
use Worksome\MultiFactorAuth\Enums\Channel;
1314
use Worksome\MultiFactorAuth\Exceptions\InvalidValueException;
1415
use Worksome\MultiFactorAuth\Models\MultiFactor;
1516

17+
/** @implements CastsAttributes<Identifier, Identifier> */
1618
class ToFieldCaster implements CastsAttributes
1719
{
1820
/** @param MultiFactor $model */

src/Models/MultiFactor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @property Carbon|null $verified_at
2828
* @property Carbon $created_at
2929
* @property Carbon $updated_at
30-
* @property MultiFactorAuthenticatable&Model $user
30+
* @property Model&MultiFactorAuthenticatable $user
3131
*/
3232
class MultiFactor extends Model
3333
{

tests/Pest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Worksome\MultiFactorAuth\Tests\TestCase;
46

5-
uses(TestCase::class)->in(__DIR__ . '/Feature');
7+
uses(TestCase::class)->in('Feature');
68

79
// Test functions
810

0 commit comments

Comments
 (0)