*/ class ServicioFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Servicio::class; /** * Define the model's default state. * * @return array */ public function definition(): array { $fotoDefault = Foto::firstOrCreate( ['ruta' => 'images/Servicio.jpg'], [ 'extension' => 'jpg', 'tamanio_bytes' => 0, 'nombre' => 'Servicio', 'mime_type' => 'image/jpeg', ] ); return [ 'titulo' => $this->faker->unique()->bs(), 'estado' => 'activo', 'descripcion' => $this->faker->sentence(12), 'visibleenweb' => 'si', 'contenidoweb_id' => DB::table('contenidoswebs')->value('id'), 'profesion_id' => Profesion::factory(), 'foto_id' => $fotoDefault->id, ]; } }