koel/app/Repositories/AlbumRepository.php

26 lines
453 B
PHP
Raw Normal View History

2018-08-29 06:30:39 +00:00
<?php
namespace App\Repositories;
use App\Models\Album;
use App\Models\Song;
2018-08-29 06:30:39 +00:00
class AlbumRepository extends AbstractRepository
{
public function getModelClass(): string
{
return Album::class;
}
public function getNonEmptyAlbumIds(): array
{
$ids = Song::select('album_id')
->groupBy('album_id')
->get()
->pluck('album_id')
->toArray();
return $ids;
}
2018-08-29 06:30:39 +00:00
}