*/ public function definition(): array { /** @var Album $album */ $album = Album::factory()->create(); return [ 'album_id' => $album->id, 'artist_id' => $album->artist->id, 'title' => $this->faker->sentence, 'length' => $this->faker->randomFloat(2, 10, 500), 'track' => random_int(1, 20), 'disc' => random_int(1, 5), 'lyrics' => $this->faker->paragraph(), 'path' => '/tmp/' . uniqid() . '.mp3', 'genre' => $this->faker->randomElement(['Rock', 'Pop', 'Jazz', 'Classical', 'Metal', 'Hip Hop', 'Rap']), 'year' => $this->faker->year(), 'is_public' => $this->faker->boolean(), 'owner_id' => User::factory(), 'mtime' => time(), ]; } public function public(): self { return $this->state(fn () => ['is_public' => true]); // @phpcs:ignore } public function private(): self { return $this->state(fn () => ['is_public' => false]); // @phpcs:ignore } }