koel/app/Repositories/ArtistRepository.php

24 lines
438 B
PHP
Raw Normal View History

2018-08-29 06:30:39 +00:00
<?php
namespace App\Repositories;
use App\Models\Artist;
use App\Models\Song;
2018-08-29 06:30:39 +00:00
class ArtistRepository extends AbstractRepository
{
public function getModelClass(): string
{
return Artist::class;
}
public function getNonEmptyArtistIds(): array
{
return Song::select('artist_id')
->groupBy('artist_id')
->get()
->pluck('artist_id')
->toArray();
}
2018-08-29 06:30:39 +00:00
}