Skip to content

[5.x] Adds L11 support #1410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5a70dda
Adds L11 support
nunomaduro Nov 27, 2023
2abe989
Adjust test suite
nunomaduro Nov 27, 2023
41c41aa
Keeps working on adding L11 support
nunomaduro Nov 27, 2023
6a5276a
wip
nunomaduro Nov 27, 2023
642147c
Fixes fortify redirect route
nunomaduro Nov 27, 2023
3b6b6fc
Removes unused replace
nunomaduro Nov 27, 2023
3fd9cab
Comments
nunomaduro Nov 27, 2023
fff46f3
Removes usage of RouteServiceProvider
nunomaduro Nov 27, 2023
a0ed698
Installs API earlier
nunomaduro Nov 27, 2023
e8066df
Fixes migrations
nunomaduro Nov 27, 2023
8283d20
Adds missing password_reset_tokens
nunomaduro Nov 27, 2023
55ceb5e
Ensures middleware folders exists
nunomaduro Nov 28, 2023
4c958b1
Removes non-used imports
nunomaduro Nov 28, 2023
55d96de
Removes non-used import
nunomaduro Nov 28, 2023
ee5a784
Uses `addProviderToBootstrapFile`
nunomaduro Nov 28, 2023
213f564
Uses `publishesMigrations` and points fortify to develop
nunomaduro Dec 5, 2023
35ded2e
Uses stable version of Jetstream
nunomaduro Dec 28, 2023
e3ece2d
Uses stable version of Inertia and Sanctum
nunomaduro Dec 28, 2023
0ca131a
Uses PHPUnit 10.4
nunomaduro Dec 28, 2023
088d441
Updates user migrations
nunomaduro Dec 28, 2023
1850a52
Avoids creation of session table if already exists
nunomaduro Dec 28, 2023
919c75c
Does not installs again Sanctum migrations
nunomaduro Dec 28, 2023
8c61df6
Fixes tests on L11
nunomaduro Dec 28, 2023
e5e75ee
Don't uses `AUTH_GUARD=sanctum`
nunomaduro Dec 28, 2023
74a4068
Updates user model
nunomaduro Dec 28, 2023
0cb0247
Apply fixes from StyleCI
StyleCIBot Dec 28, 2023
bee6c78
Uses `casts` method for `Team` model
nunomaduro Dec 28, 2023
e618530
Merge branch 'feat/slim-skeleton-11.x' of github.com:laravel/jetstrea…
nunomaduro Dec 28, 2023
36c81ea
Uses `casts` on UserWithTeams
nunomaduro Dec 28, 2023
f26b765
Updates UserFactory
nunomaduro Dec 28, 2023
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
14 changes: 11 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1, 8.2, 8.3]
laravel: [10]
php: [8.2, 8.3]
laravel: [11]

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

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
fail-fast: true
matrix:
stack: [inertia, livewire]
laravel: [10]
laravel: [11]

name: Test Stubs - Laravel ${{ matrix.laravel }} - ${{ matrix.stack }}

Expand All @@ -64,11 +64,19 @@ jobs:
coverage: none

- name: Setup Laravel
if: matrix.laravel != 11
run: |
composer create-project laravel/laravel:^${{ matrix.laravel }} .
composer require laravel/jetstream:@dev --no-interaction --no-update
composer config repositories.jetstream '{"type": "path", "url": "jetstream"}' --file composer.json

- name: Setup Laravel
if: matrix.laravel == 11
run: |
composer create-project laravel/laravel:dev-master .
composer require laravel/jetstream:@dev --no-interaction --no-update
composer config repositories.jetstream '{"type": "path", "url": "jetstream"}' --file composer.json

- name: Checkout code
uses: actions/checkout@v3
with:
Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
}
],
"require": {
"php": "^8.1.0",
"php": "^8.2.0",
"ext-json": "*",
"illuminate/console": "^10.17",
"illuminate/support": "^10.17",
"laravel/fortify": "^1.19",
"illuminate/console": "^11.0",
"illuminate/support": "^11.0",
"laravel/fortify": "dev-develop",
"mobiledetect/mobiledetectlib": "^4.8"
},
"require-dev": {
"inertiajs/inertia-laravel": "^0.6.5",
"laravel/sanctum": "^3.0",
"livewire/livewire": "^3.0",
"inertiajs/inertia-laravel": "^1.0",
"laravel/sanctum": "^4.0",
"livewire/livewire": "dev-feat/l11",
"mockery/mockery": "^1.0",
"orchestra/testbench": "^8.11",
"orchestra/testbench": "^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.1"
"phpunit/phpunit": "^10.4"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion database/factories/TeamFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Database\Factories;

use App\Models\Team;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

Expand Down
20 changes: 12 additions & 8 deletions database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Models\Team;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use Laravel\Jetstream\Features;

Expand All @@ -13,6 +14,11 @@
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;

/**
* Define the model's default state.
*
Expand All @@ -21,10 +27,10 @@ class UserFactory extends Factory
public function definition(): array
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'password' => static::$password ??= Hash::make('password'),
'two_factor_secret' => null,
'two_factor_recovery_codes' => null,
'remember_token' => Str::random(10),
Expand All @@ -38,11 +44,9 @@ public function definition(): array
*/
public function unverified(): static
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ public function up(): void
$table->string('profile_photo_path', 2048)->nullable();
$table->timestamps();
});

Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});

Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}

/**
Expand All @@ -30,5 +45,7 @@ public function up(): void
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};
Loading