feat/factory_creation (#1)
Prepping for launch. Reviewed-on: #1 Co-authored-by: Paul Couture <paul@paulcouture.com> Co-committed-by: Paul Couture <paul@paulcouture.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -4,9 +4,23 @@ namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use App\Models\Artist;
|
||||
use App\Models\Artwork;
|
||||
use App\Models\Episode;
|
||||
use App\Models\Podcast;
|
||||
use App\Models\Overlay;
|
||||
use App\Models\User;
|
||||
|
||||
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = User::class;
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
@@ -14,12 +28,14 @@ class UserFactory extends Factory
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$password = Hash::make(Str::random(rand(8, 16)));
|
||||
return [
|
||||
'name' => $this->faker->name(),
|
||||
'email' => $this->faker->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
|
||||
'password' => $password,
|
||||
'remember_token' => Str::random(10),
|
||||
'legacy_id' => null,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user