Closed JanisVepris closed 3 years ago
Provides some type for most common factory() usage.
factory()
In all following cases IDE resolves $user as the User model.
$user
User
$user = factory(User::class)->create();
$user = factory(User::class)->make();
$user = factory(User::class)->state('some-state')->create();
$user = factory(User::class)->state('deleted')->states(['deteled', 'signedUp'])->make();
$userFactory = factory(User::class); $user = $userFactory->state('deleted')->create();
$type = User::class; $user = factory($type)->create();
$type = User::class; $userFactory = factory($type); $user = $userFactory->create();
$user = factory('App\Model\User')->create();
In this case it resolves $users as Illuminate\Database\Eloquent\Collection
$users
Illuminate\Database\Eloquent\Collection
$users = factory(User::class, 3)->create();
Provides some type for most common
factory()
usage.In all following cases IDE resolves
$user
as theUser
model.In this case it resolves
$users
asIlluminate\Database\Eloquent\Collection