*/ class ShareFileFactory extends Factory { protected $model = ShareFile::class; /** * @return array */ public function definition(): array { return [ 'share_id' => Share::factory(), 'original_name' => fake()->word().'.txt', 'relative_path' => null, 'stored_path' => 'shares/'.fake()->uuid().'.enc', 'file_size' => fake()->numberBetween(1024, 10485760), 'mime_type' => 'text/plain', 'uploaded_chunks' => 1, 'completed_at' => now(), ]; } /** * A file whose chunks have not all arrived yet. */ public function uploading(): static { return $this->state(fn (array $attributes) => [ 'mime_type' => null, 'uploaded_chunks' => 0, 'completed_at' => null, ]); } }