Created
December 15, 2021 13:54
-
-
Save dominiquevienne/f9568cb18881000e988180fcfdada9b5 to your computer and use it in GitHub Desktop.
Laravel - UserFactory part
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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