<?php
|
|
|
|
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
|
|
|
use App\User;
|
|
use App\UserCategory;
|
|
use App\UserNature;
|
|
use App\UserType;
|
|
use Carbon\Carbon;
|
|
use Faker\Generator as Faker;
|
|
use Illuminate\Support\Str;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Model Factories
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This directory should contain each of the model factory definitions for
|
|
| your application. Factories provide a convenient way to generate new
|
|
| model instances for testing / seeding your application's database.
|
|
|
|
|
*/
|
|
|
|
$factory->define(User::class, function (Faker $faker) {
|
|
return [
|
|
'name' => $faker->name,
|
|
'email' => $faker->unique()->safeEmail,
|
|
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
|
|
'user_category_id' => UserCategory::where('key', 'individual')->first()->id,
|
|
'user_nature_id' => UserNature::where('key', 'individual')->first()->id,
|
|
'user_type_id' => UserType::where('key', 'individual')->first()->id,
|
|
'birthday' => Carbon::createFromFormat('d/m/Y', $faker->date('d/m/Y')),
|
|
'document' => [
|
|
'type' => 'cpf',
|
|
'number' => $faker->cpf,
|
|
],
|
|
'address' => [
|
|
'street' => $faker->streetName,
|
|
'number' => $faker->buildingNumber,
|
|
'complement' => $faker->secondaryAddress,
|
|
'neighbourhood' => $faker->words(3, true),
|
|
'city' => $faker->city,
|
|
'state' => $faker->state,
|
|
'postcode' => $faker->postcode,
|
|
'country' => $faker->country,
|
|
],
|
|
'profile' => [
|
|
'gender' => $faker->randomElement(['male', 'female', 'other']),
|
|
'occupation' => $faker->words(3, true),
|
|
'scholarity' => $faker->randomElement(['primary-school', 'high-school', 'bachelor', 'master', 'phd']),
|
|
'phone' => $faker->phoneNumber,
|
|
'secondary_emails' => $faker->email,
|
|
'website' => $faker->url,
|
|
'social' => $faker->url,
|
|
'expectation' => $faker->text,
|
|
'bike_use' => $faker->text,
|
|
'org_participation' => $faker->text,
|
|
'bike_activities' => $faker->text,
|
|
'comments' => $faker->text,
|
|
'ucb_comments' => '',
|
|
],
|
|
'contribution' => $faker->randomElement([15, 30, 60, 120, 150]),
|
|
'discussion' => $faker->randomElement(['all', 'daily', 'occasional']),
|
|
'remember_token' => Str::random(10),
|
|
];
|
|
});
|