Advertisement
refda21

WorkshopFactory.php

Mar 19th, 2021
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.44 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Database\Factories;
  4.  
  5. use App\Models\User;
  6. use App\Models\Workshop;
  7. use Illuminate\Database\Eloquent\Factories\Factory;
  8.  
  9. class WorkshopFactory extends Factory
  10. {
  11.     /**
  12.      * The name of the factory's corresponding model.
  13.      *
  14.      * @var string
  15.      */
  16.     protected $model = Workshop::class;
  17.  
  18.  
  19.     /**
  20.      * Define the model's default state.
  21.      *
  22.      * @return array
  23.      */
  24.     public function definition()
  25.     {
  26.         return [
  27.             'category_workshop' => $this->faker->randomElement(['Art & Media','Business','Economy','Management','Marketing','Science']),
  28.             'title' => $this->faker->title,
  29.             'flyer' => $this->faker->imageUrl('200','300'),
  30.             'date' => $this->faker->date(),
  31.             'status' => $this->faker->randomElement(['draft','active-class','inacvtive-class','in reveiew']),
  32.             'status_icon' => $this->faker->imageUrl('50','50'),
  33.             'admission' => $this->faker->randomElement(['free','paid']),
  34.             'time_start' => $this->faker->time(),
  35.             'platform' => $this->faker->randomElement(['zoom','google meet']),
  36.             'refundable' => $this->faker->randomElement(['yes','no']),
  37.             'reschedule'=>$this->faker->randomElement(['yes','no']),
  38.             'description'=>$this->faker->paragraph(12),
  39.             'class_type'=>$this->faker->randomElement(['workshop','webinar','online voucher','short course']),
  40.             'requirement'=>$this->faker->paragraph(5),
  41.             'ticket_include_title' => $this->faker->words(4),
  42.             'ticket_include_icon' => $this->faker->image(),
  43.             'capacity' => $this->faker->randomNumber(2),
  44.             'media_type' => $this->faker->randomElement(['online','offline']),
  45.             'location' => $this->faker->city,
  46.             'content'=>$this->faker->paragraph(20),
  47.             'link_workshop'=>$this->faker->url,
  48.             'address'=>$this->faker->address,
  49.             'price_workshop' => $this->faker->numberBetween(50000,500000),
  50.             'user_id'=> User::all()->random()->id,
  51.             'status_ticket' => $this->faker->randomElement(['avilable','sold out','comming soon']),
  52.             'workshop_speaker_name' => $this->faker->name,
  53.             'workshop_speaker_background' => $this->faker->words(5),
  54.             'workshop_speaker_description'=>$this->faker->paragraph(12),
  55.             'workshop_speaker_photo'=>$this->faker->imageUrl(80,100),
  56.         ];
  57.     }
  58. }
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement