Repository: laravel/jetstream (language: php)

Issue:
Doesn't work with Laravel 9.35 Model::preventsAccessingMissingAttributes()
- Jetstream Version: 2.x-dev
- Jetstream Stack: Livewire
- Uses Teams: yes
- Laravel Version: 9.36.3
- PHP Version: 8.1.10
- Database Driver & Version: MySQL

### Description:

Errors regarding teams when running tests. For example: 

>   The attribute [current_team_id] either does not exist or was not retrieved for model [App\Models\User].

or

>   The attribute [profile_photo_path] either does not exist or was not retrieved for model [App\Models\User].


### Steps To Reproduce:

`sail bin pest --filter "test_confirm_password_screen_can_be_rendered"`


Discussion / hints:
Confirmed with Laravel 9.36.4 and Jetstream 2.12.3 on a brand new install.

I haven't had time to fully investigate, but this seems to be related to `Auth::user()` returning an object without all the columns.
I don't think it's a bug, you have to add what you need to the UserFactory,
 ``` php
'current_team_id' => null,
'profile_photo_path' => null,
'two_factor_secret' => null,
```
 https://github.com/laravel/jetstream/pull/1162#issuecomment-1279309999
@flick36 But... the UserFactory is created by Jetstream. Shouldn't the user factory it creates work with the tests it creates, while using this new mode that people are (rightly) being encouraged to use? Really asking... maybe the answer is "no", in which case this can be solved by documentation. But making the user factory definition work with these tests in strict mode seems like a kindness that people would appreciate.
It adds everything it needs by default, it's up to you to update it based on your needs, not everyone needs teams, twofactor auth, or profile photos, that's why i think it isn't included, and you must activate thos features manually, by uncommenting the corresponding feature on `config/jetstream.php`, so if you need any of those, and YOU want to activate the strict mode, you have to add it to a service provider, you have to then add that to the UserFactory
Adding these to the user factory definition allows the tests to pass:

```php
'current_team_id' => null,
'profile_photo_path' => null,
'two_factor_secret' => null,
'two_factor_confirmed_at' => null,
'two_factor_recovery_codes' => null,
```
> not everyone needs teams, twofactor auth, or profile photos, that's why i think it isn't included, and you must activate thos features manually

I haven't activated these features. The only thing I did after a bog-standard Laravel and Jetstream (Livewire) install was add the one line to activate strict mode.

Further, the migrations to create the columns for these features are created by Jetstream regardless, so it seems reasonable to have the default user factory include defaults for these columns, even if you're not using the underlying features that they power.

If someone not using these features calls `User::first()`, they're going to get an object with these columns included. I think the factory should do the same. What's the downside?

Fix patch:
diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php
index 87058985d..001b550de 100644
--- a/database/factories/UserFactory.php
+++ b/database/factories/UserFactory.php
@@ -29,7 +29,11 @@ public function definition()
             'email' => $this->faker->unique()->safeEmail(),
             'email_verified_at' => now(),
             'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
+            'two_factor_secret' => null,
+            'two_factor_confirmed_at' => null,
+            'two_factor_recovery_codes' => null,
             'remember_token' => Str::random(10),
+            'profile_photo_path' => null,
         ];
     }
 


Test patch: