osb/database/factories/UserFactory.php

50 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2017-11-03 05:26:07 +00:00
<?php
namespace Database\Factories;
2017-11-03 05:26:07 +00:00
use App\Models\Country;
use App\Models\Language;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
2017-11-03 05:26:07 +00:00
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
// Create Dependencies - should be loaded by seeding.
$co = Country::findOrFail(61);
$lo = Language::findOrFail(1);
return [
'id' => $this->faker->numberBetween(2048,65535),
// 'created_at'
// 'updated_at'
//* 'site_id', // Needs to be passed in
'email' => $this->faker->unique()->safeEmail,
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'remember_token' => Str::random(10),
'active' => 1,
// 'title'
'firstname' => $this->faker->name,
'lastname' => $this->faker->name,
'country_id' => $co->id,
// 'address1'
// 'address2'
// 'city'
// 'state'
// 'postcode'
'emailable' => true,
// 'parent_id''
'language_id' => $lo->id,
];
}
}