Sistema de controles da União de Ciclistas do Brasil
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

66 lines
2.6 KiB

<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Associate;
use App\AssociateCategory;
use App\AssociateNature;
use App\AssociateType;
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(Associate::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'associate_category_id' => AssociateCategory::where('key', 'individual')->first()->id,
'associate_nature_id' => AssociateNature::where('key', 'individual')->first()->id,
'associate_type_id' => AssociateType::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),
];
});