koel/app/Repositories/AlbumRepository.php

22 lines
414 B
PHP
Raw Normal View History

2018-08-29 06:30:39 +00:00
<?php
namespace App\Repositories;
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;
2020-12-22 20:11:22 +00:00
/** @return array<int> */
public function getNonEmptyAlbumIds(): array
{
2020-12-22 20:11:22 +00:00
return Song::select('album_id')
->groupBy('album_id')
->get()
->pluck('album_id')
->toArray();
}
2018-08-29 06:30:39 +00:00
}