2018-08-29 06:30:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
2018-08-29 09:41:24 +00:00
|
|
|
use App\Models\Song;
|
2020-12-23 11:03:22 +00:00
|
|
|
use App\Repositories\Traits\Searchable;
|
2018-08-29 06:30:39 +00:00
|
|
|
|
|
|
|
class AlbumRepository extends AbstractRepository
|
|
|
|
{
|
2020-12-23 11:03:22 +00:00
|
|
|
use Searchable;
|
2018-08-29 09:41:24 +00:00
|
|
|
|
2020-12-22 20:11:22 +00:00
|
|
|
/** @return array<int> */
|
2018-08-29 09:41:24 +00:00
|
|
|
public function getNonEmptyAlbumIds(): array
|
|
|
|
{
|
2020-12-22 20:11:22 +00:00
|
|
|
return Song::select('album_id')
|
2018-08-29 09:41:24 +00:00
|
|
|
->groupBy('album_id')
|
|
|
|
->get()
|
|
|
|
->pluck('album_id')
|
|
|
|
->toArray();
|
|
|
|
}
|
2018-08-29 06:30:39 +00:00
|
|
|
}
|