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-24 12:41:18 +00:00
|
|
|
use App\Repositories\Traits\Searchable;
|
2018-08-29 06:30:39 +00:00
|
|
|
|
|
|
|
class ArtistRepository extends AbstractRepository
|
|
|
|
{
|
2020-12-24 12:41:18 +00:00
|
|
|
use Searchable;
|
|
|
|
|
2020-12-22 20:11:22 +00:00
|
|
|
/** @return array<int> */
|
2018-08-29 09:41:24 +00:00
|
|
|
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
|
|
|
}
|