koel/app/Http/Controllers/API/Interaction/RecentlyPlayedController.php

22 lines
581 B
PHP
Raw Normal View History

<?php
namespace App\Http\Controllers\API\Interaction;
2022-07-29 06:47:10 +00:00
use App\Http\Controllers\Controller;
2022-06-10 10:47:46 +00:00
use App\Models\User;
use App\Repositories\InteractionRepository;
2020-10-26 15:29:29 +00:00
use Illuminate\Contracts\Auth\Authenticatable;
class RecentlyPlayedController extends Controller
{
2022-06-10 10:47:46 +00:00
/** @param User $user */
2022-07-29 06:47:10 +00:00
public function __construct(private InteractionRepository $interactionRepository, private ?Authenticatable $user)
{
}
2020-10-26 15:29:29 +00:00
public function index(?int $count = null)
{
2022-06-10 10:47:46 +00:00
return response()->json($this->interactionRepository->getRecentlyPlayed($this->user, $count));
}
}