diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fe7d815a1..c0402e3e2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,8 +13,13 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4, 8.0, 8.1] - laravel: [^8.0] + php: [7.3, 7.4, '8.0', 8.1] + laravel: [8, 9] + exclude: + - php: 7.3 + laravel: 9 + - php: 7.4 + laravel: 9 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} @@ -32,7 +37,7 @@ jobs: - name: Install dependencies run: | - composer require "illuminate/contracts=${{ matrix.laravel }}" --no-update + composer require "illuminate/contracts=^${{ matrix.laravel }}" --no-update composer update --prefer-dist --no-interaction --no-progress - name: Execute tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 57d02b3fd..73abb6399 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,21 @@ # Release Notes -## [Unreleased](https://github.com/laravel/jetstream/compare/v2.5.0...2.x) +## [Unreleased](https://github.com/laravel/jetstream/compare/v2.6.0...2.x) + + +## [v2.6.0 (2022-01-12)](https://github.com/laravel/jetstream/compare/v2.5.1...v2.6.0) + +### Changed +- Laravel 9 Support ([#948](https://github.com/laravel/jetstream/pull/948)) +- Anonymize default profile photo url calls ([#940](https://github.com/laravel/jetstream/pull/940)) + + +## [v2.5.1 (2022-01-04)](https://github.com/laravel/jetstream/compare/v2.5.0...v2.5.1) + +### Changed +* Fixed a content reflow issue on slower connection in update profile info form ([#929](https://github.com/laravel/jetstream/pull/929)) +* Fixed a button spacing issue in dialog modal footer ([#930](https://github.com/laravel/jetstream/pull/930), [#935](https://github.com/laravel/jetstream/pull/935)) +* Show 'Unknown' instead of 'false' if other browser session Useragent details are not matched in library ([#934](https://github.com/laravel/jetstream/pull/934)) ## [v2.5.0 (2021-12-14)](https://github.com/laravel/jetstream/compare/v2.4.4...v2.5.0) diff --git a/composer.json b/composer.json index b9bd5495c..55af7e042 100644 --- a/composer.json +++ b/composer.json @@ -16,15 +16,15 @@ "require": { "php": "^7.3|^8.0", "ext-json": "*", - "illuminate/support": "^8.0", + "illuminate/support": "^8.0|^9.0", "jenssegers/agent": "^2.6", - "laravel/fortify": "^1.6.1" + "laravel/fortify": "^1.9" }, "require-dev": { - "inertiajs/inertia-laravel": "^0.3", - "laravel/sanctum": "^2.6", + "inertiajs/inertia-laravel": "^0.5.2", + "laravel/sanctum": "^2.7", "mockery/mockery": "^1.0", - "orchestra/testbench": "^6.0", + "orchestra/testbench": "^6.0|^7.0", "phpunit/phpunit": "^9.3" }, "autoload": { diff --git a/src/HasProfilePhoto.php b/src/HasProfilePhoto.php index d5bb4ced8..9295e4aa1 100644 --- a/src/HasProfilePhoto.php +++ b/src/HasProfilePhoto.php @@ -4,6 +4,7 @@ use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; +use Illuminate\Support\Str; use Laravel\Jetstream\Features; trait HasProfilePhoto @@ -66,7 +67,11 @@ public function getProfilePhotoUrlAttribute() */ protected function defaultProfilePhotoUrl() { - return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=7F9CF5&background=EBF4FF'; + $name = trim(collect(explode(' ', $this->name))->map(function ($segment) { + return $segment[0] ?? ''; + })->join(' ')); + + return 'https://ui-avatars.com/api/?name='.urlencode($name).'&color=7F9CF5&background=EBF4FF'; } /** diff --git a/stubs/tests/EmailVerificationTest.php b/stubs/tests/EmailVerificationTest.php index 0b4ce1992..f240e124c 100644 --- a/stubs/tests/EmailVerificationTest.php +++ b/stubs/tests/EmailVerificationTest.php @@ -21,9 +21,7 @@ public function test_email_verification_screen_can_be_rendered() return $this->markTestSkipped('Email verification not enabled.'); } - $user = User::factory()->withPersonalTeam()->create([ - 'email_verified_at' => null, - ]); + $user = User::factory()->withPersonalTeam()->unverified()->create(); $response = $this->actingAs($user)->get('/email/verify'); @@ -38,9 +36,7 @@ public function test_email_can_be_verified() Event::fake(); - $user = User::factory()->create([ - 'email_verified_at' => null, - ]); + $user = User::factory()->unverified()->create(); $verificationUrl = URL::temporarySignedRoute( 'verification.verify', @@ -62,9 +58,7 @@ public function test_email_can_not_verified_with_invalid_hash() return $this->markTestSkipped('Email verification not enabled.'); } - $user = User::factory()->create([ - 'email_verified_at' => null, - ]); + $user = User::factory()->unverified()->create(); $verificationUrl = URL::temporarySignedRoute( 'verification.verify', diff --git a/stubs/tests/PasswordConfirmationTest.php b/stubs/tests/PasswordConfirmationTest.php index 6bb50c596..a31fbab92 100644 --- a/stubs/tests/PasswordConfirmationTest.php +++ b/stubs/tests/PasswordConfirmationTest.php @@ -13,9 +13,7 @@ class PasswordConfirmationTest extends TestCase public function test_confirm_password_screen_can_be_rendered() { - $user = Features::hasTeamFeatures() - ? User::factory()->withPersonalTeam()->create() - : User::factory()->create(); + $user = User::factory()->withPersonalTeam()->create(); $response = $this->actingAs($user)->get('/user/confirm-password'); diff --git a/stubs/tests/inertia/ApiTokenPermissionsTest.php b/stubs/tests/inertia/ApiTokenPermissionsTest.php index 679ef55b4..d086e74be 100644 --- a/stubs/tests/inertia/ApiTokenPermissionsTest.php +++ b/stubs/tests/inertia/ApiTokenPermissionsTest.php @@ -18,11 +18,7 @@ public function test_api_token_permissions_can_be_updated() return $this->markTestSkipped('API support is not enabled.'); } - if (Features::hasTeamFeatures()) { - $this->actingAs($user = User::factory()->withPersonalTeam()->create()); - } else { - $this->actingAs($user = User::factory()->create()); - } + $this->actingAs($user = User::factory()->withPersonalTeam()->create()); $token = $user->tokens()->create([ 'name' => 'Test Token', diff --git a/stubs/tests/inertia/CreateApiTokenTest.php b/stubs/tests/inertia/CreateApiTokenTest.php index 1c4168b1d..11846fad0 100644 --- a/stubs/tests/inertia/CreateApiTokenTest.php +++ b/stubs/tests/inertia/CreateApiTokenTest.php @@ -17,11 +17,7 @@ public function test_api_tokens_can_be_created() return $this->markTestSkipped('API support is not enabled.'); } - if (Features::hasTeamFeatures()) { - $this->actingAs($user = User::factory()->withPersonalTeam()->create()); - } else { - $this->actingAs($user = User::factory()->create()); - } + $this->actingAs($user = User::factory()->withPersonalTeam()->create()); $response = $this->post('/user/api-tokens', [ 'name' => 'Test Token', diff --git a/stubs/tests/inertia/DeleteApiTokenTest.php b/stubs/tests/inertia/DeleteApiTokenTest.php index db6800aae..a21b48f42 100644 --- a/stubs/tests/inertia/DeleteApiTokenTest.php +++ b/stubs/tests/inertia/DeleteApiTokenTest.php @@ -18,11 +18,7 @@ public function test_api_tokens_can_be_deleted() return $this->markTestSkipped('API support is not enabled.'); } - if (Features::hasTeamFeatures()) { - $this->actingAs($user = User::factory()->withPersonalTeam()->create()); - } else { - $this->actingAs($user = User::factory()->create()); - } + $this->actingAs($user = User::factory()->withPersonalTeam()->create()); $token = $user->tokens()->create([ 'name' => 'Test Token', diff --git a/stubs/tests/livewire/ApiTokenPermissionsTest.php b/stubs/tests/livewire/ApiTokenPermissionsTest.php index 829b42258..5fbd9091e 100644 --- a/stubs/tests/livewire/ApiTokenPermissionsTest.php +++ b/stubs/tests/livewire/ApiTokenPermissionsTest.php @@ -20,11 +20,7 @@ public function test_api_token_permissions_can_be_updated() return $this->markTestSkipped('API support is not enabled.'); } - if (Features::hasTeamFeatures()) { - $this->actingAs($user = User::factory()->withPersonalTeam()->create()); - } else { - $this->actingAs($user = User::factory()->create()); - } + $this->actingAs($user = User::factory()->withPersonalTeam()->create()); $token = $user->tokens()->create([ 'name' => 'Test Token', diff --git a/stubs/tests/livewire/CreateApiTokenTest.php b/stubs/tests/livewire/CreateApiTokenTest.php index e0834fa3a..465ea387e 100644 --- a/stubs/tests/livewire/CreateApiTokenTest.php +++ b/stubs/tests/livewire/CreateApiTokenTest.php @@ -19,11 +19,7 @@ public function test_api_tokens_can_be_created() return $this->markTestSkipped('API support is not enabled.'); } - if (Features::hasTeamFeatures()) { - $this->actingAs($user = User::factory()->withPersonalTeam()->create()); - } else { - $this->actingAs($user = User::factory()->create()); - } + $this->actingAs($user = User::factory()->withPersonalTeam()->create()); Livewire::test(ApiTokenManager::class) ->set(['createApiTokenForm' => [ diff --git a/stubs/tests/livewire/DeleteApiTokenTest.php b/stubs/tests/livewire/DeleteApiTokenTest.php index a8844c040..9128862f0 100644 --- a/stubs/tests/livewire/DeleteApiTokenTest.php +++ b/stubs/tests/livewire/DeleteApiTokenTest.php @@ -20,11 +20,7 @@ public function test_api_tokens_can_be_deleted() return $this->markTestSkipped('API support is not enabled.'); } - if (Features::hasTeamFeatures()) { - $this->actingAs($user = User::factory()->withPersonalTeam()->create()); - } else { - $this->actingAs($user = User::factory()->create()); - } + $this->actingAs($user = User::factory()->withPersonalTeam()->create()); $token = $user->tokens()->create([ 'name' => 'Test Token',