Caleb White

Results 344 comments of Caleb White

The issue here likely stems from the fact that the [laravel/legacy-factories](https://github.com/laravel/legacy-factories) package overrides the [`Illuminate\Database\Eloquent\Factory`](https://github.com/laravel/legacy-factories/blob/6cb79f668fc36b8b396ada1da3ba45867889c30f/src/Factory.php#L9) class with a custom implementation. Edit: I missed that the new factory is now `Illuminate\Database\Eloquent\Factories\Factory`...

Ah, I found the issue---Larastan does not actually take into account the `newFactory` method and only looks for factories that match the expected pattern: https://github.com/larastan/larastan/blob/92376b5b7ed1f34cdfef92fc685dcd94348c8e65/src/ReturnTypes/ModelFactoryDynamicStaticMethodReturnTypeExtension.php#L71

@darfijt, this works for me and the base factory class has the proper annotation: https://github.com/laravel/framework/blob/e574ffa03436a85d0aefccca9d8127746b3032aa/src/Illuminate/Database/Eloquent/Factories/Factory.php#L21-L26 Your user factory might need the proper generics: ```php /** @extends Factory */ class UserFactory...

@ednar28, can you provide a minimum reproducible example? I am not seeing this error: https://phpstan.org/r/6146e0f3-0358-4188-92d5-267754a55a78

That's not an MRE...and the phpstan link I posted above is running on level 9

So the following passes on Larastan 2.4.6 level 9: ```php

> Also the branch has merge conflicts now. That's why it is a good idea to put any test case in GeneralTypeTest to at the end of the file. The...

Note, I could remove the existence check if using `model-property` will check existence instead: ```php /** @var array */ protected $appends = [ 'computed_property', 'non_existent', 'email', // This is a...