Skip to content

Commit

Permalink
Merge branch 'laravel-2.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
syntaxlexx committed Jan 24, 2022
2 parents 5964b25 + 6acd58f commit 0d98636
Show file tree
Hide file tree
Showing 36 changed files with 184 additions and 141 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
Expand Down
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
# Release Notes

## [Unreleased](https://github.com/laravel/jetstream/compare/v2.5.0...2.x)
## [Unreleased](https://github.com/laravel/jetstream/compare/v2.6.2...2.x)


## [v2.6.2 (2022-01-18)](https://github.com/laravel/jetstream/compare/v2.6.1...v2.6.2)

### Changed
- Route group Sanctum guard ([#957](https://github.com/laravel/jetstream/pull/957))
- Add config option for guard ([82724e7](https://github.com/laravel/jetstream/commit/82724e7d7053fbaed82fcd9f196cdea4f1ca311f))
- Make config stub and set default guard ([fff4df4](https://github.com/laravel/jetstream/commit/fff4df4dbe2ab9aa03ecd8f0120399b91ec6aef9))


## [v2.6.1 (2022-01-13)](https://github.com/laravel/jetstream/compare/v2.6.0...v2.6.1)

### Changed
- Bump `inertiajs/inertia-laravel` ([#954](https://github.com/laravel/jetstream/pull/954))


## [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)
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,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": {
Expand Down
56 changes: 1 addition & 55 deletions config/jetstream.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,9 @@
use Laravel\Jetstream\Features;

return [

/*
|--------------------------------------------------------------------------
| Jetstream Stack
|--------------------------------------------------------------------------
|
| This configuration value informs Jetstream which "stack" you will be
| using for your application. In general, this value is set for you
| during installation and will not need to be changed after that.
|
*/

'stack' => 'inertia',

/*
|--------------------------------------------------------------------------
| Jetstream Route Middleware
|--------------------------------------------------------------------------
|
| Here you may specify which middleware Jetstream will assign to the routes
| that it registers with the application. When necessary, you may modify
| these middleware; however, this default value is usually sufficient.
|
*/

'middleware' => ['web'],

/*
|--------------------------------------------------------------------------
| Features
|--------------------------------------------------------------------------
|
| Some of Jetstream's features are optional. You may disable the features
| by removing them from this array. You're free to only remove some of
| these features or you can even remove all of these if you need to.
|
*/

'features' => [
// Features::termsAndPrivacyPolicy(),
// Features::profilePhotos(),
// Features::api(),
// Features::teams(['invitations' => true]),
Features::accountDeletion(),
],

/*
|--------------------------------------------------------------------------
| Profile Photo Disk
|--------------------------------------------------------------------------
|
| This configuration value determines the default disk that will be used
| when storing profile photos for your application's users. Typically
| this will be the "public" disk but you may adjust this if needed.
|
*/

'features' => [Features::accountDeletion()],
'profile_photo_disk' => 'public',

/*
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/2014_10_12_000000_create_users_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
Expand Down Expand Up @@ -35,4 +35,4 @@ public function down()
{
Schema::dropIfExists('users');
}
}
};
4 changes: 2 additions & 2 deletions database/migrations/2020_05_21_100000_create_teams_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTeamsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
Expand All @@ -31,4 +31,4 @@ public function down()
{
Schema::dropIfExists('teams');
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTeamUserTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
Expand Down Expand Up @@ -33,4 +33,4 @@ public function down()
{
Schema::dropIfExists('team_user');
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTeamInvitationsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
Expand Down Expand Up @@ -33,4 +33,4 @@ public function down()
{
Schema::dropIfExists('team_invitations');
}
}
};
2 changes: 1 addition & 1 deletion resources/views/components/confirmation-modal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>
</div>

<div class="px-6 py-4 bg-gray-100 text-right">
<div class="flex flex-row justify-end px-6 py-4 bg-gray-100 text-right">
{{ $footer }}
</div>
</x-jet-modal>
2 changes: 1 addition & 1 deletion resources/views/components/confirms-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{{ __('Cancel') }}
</x-jet-secondary-button>

<x-jet-button class="ml-2" dusk="confirm-password-button" wire:click="confirmPassword" wire:loading.attr="disabled">
<x-jet-button class="ml-3" dusk="confirm-password-button" wire:click="confirmPassword" wire:loading.attr="disabled">
{{ $button }}
</x-jet-button>
</x-slot>
Expand Down
6 changes: 5 additions & 1 deletion routes/inertia.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
Route::get('/privacy-policy', [PrivacyPolicyController::class, 'show'])->name('policy.show');
}

Route::group(['middleware' => ['auth', 'verified']], function () {
$authMiddleware = config('jetstream.guard')
? 'auth:'.config('jetstream.guard')
: 'auth';

Route::group(['middleware' => [$authMiddleware, 'verified']], function () {
// User & Profile...
Route::get('/user/profile', [UserProfileController::class, 'show'])
->name('profile.show');
Expand Down
6 changes: 5 additions & 1 deletion routes/livewire.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
Route::get('/privacy-policy', [PrivacyPolicyController::class, 'show'])->name('policy.show');
}

Route::group(['middleware' => ['auth', 'verified']], function () {
$authMiddleware = config('jetstream.guard')
? 'auth:'.config('jetstream.guard')
: 'auth';

Route::group(['middleware' => [$authMiddleware, 'verified']], function () {
// User & Profile...
Route::get('/user/profile', [UserProfileController::class, 'show'])
->name('profile.show');
Expand Down
2 changes: 1 addition & 1 deletion src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ protected function livewireRouteDefinition()
protected function installInertiaStack()
{
// Install Inertia...
$this->requireComposerPackages('inertiajs/inertia-laravel:^0.4.3', 'tightenco/ziggy:^1.0');
$this->requireComposerPackages('inertiajs/inertia-laravel:^0.5.2', 'tightenco/ziggy:^1.0');

// Install NPM packages...
$this->updateNodePackages(function ($packages) {
Expand Down
11 changes: 10 additions & 1 deletion src/HasProfilePhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Laravel\Jetstream\Features;

trait HasProfilePhoto
Expand Down Expand Up @@ -40,6 +41,10 @@ public function deleteProfilePhoto()
return;
}

if (is_null($this->profile_photo_path)) {
return;
}

Storage::disk($this->profilePhotoDisk())->delete($this->profile_photo_path);

$this->forceFill([
Expand All @@ -66,7 +71,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';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/JetstreamServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected function configurePublishing()
}

$this->publishes([
__DIR__.'/../config/jetstream.php' => config_path('jetstream.php'),
__DIR__.'/../stubs/config/jetstream.php' => config_path('jetstream.php'),
], 'jetstream-config');

$this->publishes([
Expand Down
78 changes: 78 additions & 0 deletions stubs/config/jetstream.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php

use Laravel\Jetstream\Features;

return [

/*
|--------------------------------------------------------------------------
| Jetstream Stack
|--------------------------------------------------------------------------
|
| This configuration value informs Jetstream which "stack" you will be
| using for your application. In general, this value is set for you
| during installation and will not need to be changed after that.
|
*/

'stack' => 'inertia',

/*
|--------------------------------------------------------------------------
| Jetstream Route Middleware
|--------------------------------------------------------------------------
|
| Here you may specify which middleware Jetstream will assign to the routes
| that it registers with the application. When necessary, you may modify
| these middleware; however, this default value is usually sufficient.
|
*/

'middleware' => ['web'],

/*
|--------------------------------------------------------------------------
| Jetstream Guard
|--------------------------------------------------------------------------
|
| Here you may specify the authentication guard Jetstream will use while
| authenticating users. This value should correspond with one of your
| guards that is already present in your "auth" configuration file.
|
*/

'guard' => 'sanctum',

/*
|--------------------------------------------------------------------------
| Features
|--------------------------------------------------------------------------
|
| Some of Jetstream's features are optional. You may disable the features
| by removing them from this array. You're free to only remove some of
| these features or you can even remove all of these if you need to.
|
*/

'features' => [
// Features::termsAndPrivacyPolicy(),
// Features::profilePhotos(),
// Features::api(),
// Features::teams(['invitations' => true]),
Features::accountDeletion(),
],

/*
|--------------------------------------------------------------------------
| Profile Photo Disk
|--------------------------------------------------------------------------
|
| This configuration value determines the default disk that will be used
| when storing profile photos for your application's users. Typically
| this will be the "public" disk but you may adjust this if needed.
|
*/

'profile_photo_disk' => 'public',

];
2 changes: 1 addition & 1 deletion stubs/inertia/resources/js/Jetstream/ConfirmationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</div>
</div>

<div class="px-6 py-4 bg-gray-100 text-right">
<div class="flex flex-row justify-end px-6 py-4 bg-gray-100 text-right">
<slot name="footer">
</slot>
</div>
Expand Down
2 changes: 1 addition & 1 deletion stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Cancel
</jet-secondary-button>

<jet-button class="ml-2" @click="confirmPassword" :class="{ 'opacity-25': form.processing }" :disabled="form.processing">
<jet-button class="ml-3" @click="confirmPassword" :class="{ 'opacity-25': form.processing }" :disabled="form.processing">
{{ button }}
</jet-button>
</template>
Expand Down
Loading

0 comments on commit 0d98636

Please sign in to comment.