Answers for "user::factory()->create()"

PHP
0

add factory data laravel

For Laravel version 7.* and less
factory(AppUser::class, 3)->make();

Use create method to persist them to the database:
factory(AppUser::class, 3)->create();
Posted by: Guest on November-28-2020
-1

User::factory()->create(

$user = User::factory()->create();

$response = $this->actingAs($user, 'api')->json('POST', ...
Posted by: Guest on April-17-2021

Browse Popular Code Answers by Language