the browser-facing portion of osu!
at master 108 lines 3.2 kB view raw
1<?php 2 3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4// See the LICENCE file in the repository root for full licence text. 5 6declare(strict_types=1); 7 8namespace Database\Factories\Store; 9 10use App\Models\Store\Product; 11use Database\Factories\Factory; 12 13class ProductFactory extends Factory 14{ 15 protected $model = Product::class; 16 17 public function childBanners(): static 18 { 19 return $this->state([ 20 'base_shipping' => 0.00, 21 'cost' => 5.00, 22 'custom_class' => 'mwc7-supporter', 23 'display_order' => -10, 24 'max_quantity' => 1, 25 'next_shipping' => 0.00, 26 'stock' => null, 27 'weight' => null, 28 ]); 29 } 30 31 public function childTshirt(): static 32 { 33 return $this->state([ 34 'base_shipping' => 5.00, 35 'cost' => 16.00, 36 'max_quantity' => 5, 37 'name' => fn() => "osu! t-shirt (triangles) / {$this->faker->colorName}", 38 'next_shipping' => 4.00, 39 'stock' => rand(1, 100), 40 'weight' => 100, 41 ]); 42 } 43 44 public function definition(): array 45 { 46 return [ 47 'base_shipping' => 5.00, 48 'cost' => 16.00, 49 'max_quantity' => 1, 50 'name' => fn() => "Imagination / {$this->faker->colorName}", 51 'next_shipping' => 4.00, 52 'stock' => rand(1, 100), 53 'weight' => 100, 54 ]; 55 } 56 57 public function disabled(): static 58 { 59 return $this->state(['enabled' => false]); 60 } 61 62 public function masterTshirt(): static 63 { 64 return $this->state([ 65 'base_shipping' => 5.00, 66 'cost' => 16.00, 67 'description' => <<<EOF 68Brand new osu! t-shirts have arrived! Featuring a tasty triangle design by osu! designer flyte, it's a welcome addition to any avid osu! player’s wardrobe. 69 70* 100% cotton 71* Medium weight, pre-shrunk 72* Sizes: S, M, L, XL 73 74``` 75Size S M L XL 76Garment Length 66cm 70cm 74cm 78cm 77Body width 49cm 52cm 55cm 58cm 78Shoulder width 44cm 47cm 50cm 53cm 79Sleeve length 19cm 20cm 22cm 24cm 80``` 81 82NOTE: These are Japanese sizes. Overseas customers are advised to check the size chart above! 83EOF, 84 'header_description' => '# osu! t-shirt swag', 85 'header_image' => 'https://puu.sh/hzgoB/1142f14e8b.jpg', 86 'images_json' => json_encode([ 87 ['https://puu.sh/hxpsp/d0b8704769.jpg', 'https://puu.sh/hxpsp/d0b8704769.jpg'], 88 ['https://puu.sh/hxptO/71121e05e7.jpg', 'https://puu.sh/hxptO/71121e05e7.jpg'], 89 ['https://puu.sh/hzfUF/1b9af4dbd1.jpg', 'https://puu.sh/hzfUF/1b9af4dbd1.jpg'], 90 ]), 91 'max_quantity' => 5, 92 'name' => fn() => "osu! t-shirt (triangles) / {$this->faker->colorName}", 93 'next_shipping' => 4.00, 94 'promoted' => 1, 95 'stock' => rand(1, 100), 96 'weight' => 100, 97 ]); 98 } 99 100 public function virtual(): static 101 { 102 return $this->state([ 103 'base_shipping' => 0.00, 104 'next_shipping' => 0.00, 105 'weight' => null, 106 ]); 107 } 108}