2024-01-01 11:40:21 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Values;
|
|
|
|
|
|
|
|
use App\Models\Song;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
2024-01-04 21:51:32 +00:00
|
|
|
final class QueueState
|
2024-01-01 11:40:21 +00:00
|
|
|
{
|
|
|
|
private function __construct(public Collection $songs, public ?Song $currentSong, public ?int $playbackPosition)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-01-04 21:51:32 +00:00
|
|
|
public static function make(Collection $songs, ?Song $currentSong = null, ?int $playbackPosition = 0): self
|
2024-01-01 11:40:21 +00:00
|
|
|
{
|
2024-01-04 21:51:32 +00:00
|
|
|
return new self($songs, $currentSong, $playbackPosition);
|
2024-01-01 11:40:21 +00:00
|
|
|
}
|
|
|
|
}
|