*/ public function definition(): array { return [ 'page_id' => Page::factory(), 'hash' => $this->faker->lexify('????????????'), 'original_filename' => $this->faker->word().'.pdf', 'stored_filename' => $this->faker->uuid().'.pdf', 'disk' => 'local', 'path' => 'pages/attachments/'.$this->faker->uuid().'.pdf', 'mime_type' => 'application/pdf', 'size' => $this->faker->numberBetween(1024, 10485760), 'collection' => 'attachments', 'order' => 0, 'meta' => null, 'created_by' => User::factory(), ]; } /** * 이미지 첨부파일로 설정 * * @return static */ public function image(): static { return $this->state(fn (array $attributes) => [ 'original_filename' => $this->faker->word().'.jpg', 'stored_filename' => $this->faker->uuid().'.jpg', 'path' => 'pages/attachments/'.$this->faker->uuid().'.jpg', 'mime_type' => 'image/jpeg', 'meta' => [ 'width' => 800, 'height' => 600, ], ]); } /** * 임시 첨부파일로 설정 * * @return static */ public function temporary(): static { $tempKey = $this->faker->uuid(); return $this->state(fn (array $attributes) => [ 'page_id' => null, 'temp_key' => $tempKey, 'path' => "temp/{$tempKey}/".$this->faker->uuid().'.pdf', ]); } }