Skip to content

Instantly share code, notes, and snippets.

@dominiquevienne
Created December 15, 2021 13:54
Show Gist options
  • Save dominiquevienne/f9568cb18881000e988180fcfdada9b5 to your computer and use it in GitHub Desktop.
Save dominiquevienne/f9568cb18881000e988180fcfdada9b5 to your computer and use it in GitHub Desktop.
Laravel - UserFactory part
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
}
/** SOME MORE CODE **/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment