Fix Model Factory

This commit is contained in:
Sebastian Schmidt 2018-10-01 16:07:23 +10:00
parent a8d6d9efff
commit 974d7d2869
No known key found for this signature in database
GPG Key ID: 80B9687901B6587C
1 changed files with 33 additions and 16 deletions

View File

@ -124,16 +124,27 @@ $factory->define(App\Models\User::class, function (Faker\Generator $faker) {
$factory->define(App\Models\Organiser::class, function (Faker\Generator $faker) {
return [
'account_id' => factory(App\Models\Account::class)->create()->id,
'name' => $faker->name,
'about' => $faker->text,
'email' => $faker->email,
'phone' => $faker->phoneNumber,
'facebook' => 'https://facebook.com/organizer-profile',
'twitter' => 'https://twitter.com/organizer-profile',
'logo_path' => 'path/to/logo',
'is_email_confirmed' => 0,
'confirmation_key' => str_random(15),
'account_id' => factory(App\Models\Account::class)->create()->id,
'name' => $faker->name,
'about' => $faker->text,
'email' => $faker->email,
'phone' => $faker->phoneNumber,
'facebook' => 'https://facebook.com/organizer-profile',
'twitter' => 'https://twitter.com/organizer-profile',
'logo_path' => 'path/to/logo',
'is_email_confirmed' => 0,
'confirmation_key' => str_random(15),
'show_twitter_widget' => $faker->boolean,
'show_facebook_widget' => $faker->boolean,
'page_header_bg_color' => $faker->hexcolor,
'page_bg_color' => '#ffffff',
'page_text_color' => '#000000',
'enable_organiser_page' => $faker->boolean,
'google_analytics_code' => null,
'tax_name' => $faker->text(11) . ' tax',
'tax_value' => $faker->randomFloat(2, 0, 30),
'tax_id' => $faker->randomDigitNotNull,
'charge_tax' => $faker->boolean
];
});
@ -190,8 +201,8 @@ $factory->define(App\Models\Order::class, function (Faker\Generator $faker) {
'last_name' => $faker->lastName,
'email' => $faker->email,
'ticket_pdf_path' => '/ticket/pdf/path',
'order_reference' => $faker->text,
'transaction_id' => $faker->text,
'order_reference' => $faker->text(15),
'transaction_id' => $faker->text(50),
'discount' => .20,
'booking_fee' => .10,
'organiser_booking_fee' => .10,
@ -203,7 +214,10 @@ $factory->define(App\Models\Order::class, function (Faker\Generator $faker) {
'is_refunded' => 0,
'amount' => 20.00,
'amount_refunded' => 0,
'event_id' => factory(App\Models\Event::class)->create()->id
'event_id' => factory(App\Models\Event::class)->create()->id,
'payment_gateway_id' => 1,
'is_payment_received' => false,
'taxamt' => 0
];
});
@ -213,7 +227,7 @@ $factory->define(App\Models\Ticket::class, function (Faker\Generator $faker) {
'user_id' => factory(App\Models\User::class)->create()->id,
'edited_by_user_id' => factory(App\Models\User::class)->create()->id,
'account_id' => factory(App\Models\Account::class)->create()->id,
'order_id' => factory(App\Models\OrderStatus::class)->create()->id,
'order_id' => factory(App\Models\Order::class)->create()->id,
'event_id' => factory(App\Models\Event::class)->create()->id,
'title' => $faker->name,
'description' => $faker->text,
@ -226,7 +240,10 @@ $factory->define(App\Models\Ticket::class, function (Faker\Generator $faker) {
'end_sale_date' => Carbon::now()->addDays(20),
'sales_volume' => 0,
'organiser_fees_volume' => 0,
'is_paused' => 0
'is_paused' => 0,
'public_id' => null,
'sort_order' => 0,
'is_hidden' => false
];
});
@ -264,6 +281,7 @@ $factory->define(App\Models\Attendee::class, function (Faker\Generator $faker) {
'reference_index' => $faker->numberBetween(),
'private_reference_number' => 1,
'is_cancelled' => false,
'is_refunded' => false,
'has_arrived' => false,
'arrival_time' => Carbon::now(),
'account_id' => factory(App\Models\Account::class)->create()->id,
@ -286,4 +304,3 @@ $factory->define(App\Models\EventImage::class, function (Faker\Generator $faker)
'user_id' => factory(App\Models\User::class)->create()->id
];
});