mirror of
https://github.com/koel/koel
synced 2024-12-23 19:13:06 +00:00
22 lines
496 B
PHP
22 lines
496 B
PHP
<?php
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\Interaction;
|
|
use App\Models\User;
|
|
use Illuminate\Support\Collection;
|
|
|
|
class InteractionRepository extends Repository
|
|
{
|
|
/** @return Collection|array<Interaction> */
|
|
public function getUserFavorites(User $user): Collection
|
|
{
|
|
return Interaction::query()
|
|
->where([
|
|
'user_id' => $user->id,
|
|
'liked' => true,
|
|
])
|
|
->with('song')
|
|
->pluck('song');
|
|
}
|
|
}
|