koel/app/Http/Controllers/API/Interaction/RecentlyPlayedController.php
2021-06-05 12:47:56 +02:00

27 lines
782 B
PHP

<?php
namespace App\Http\Controllers\API\Interaction;
use App\Repositories\InteractionRepository;
use App\Services\InteractionService;
use Illuminate\Contracts\Auth\Authenticatable;
class RecentlyPlayedController extends Controller
{
private InteractionRepository $interactionRepository;
public function __construct(
InteractionService $interactionService,
InteractionRepository $interactionRepository,
?Authenticatable $currentUser
) {
parent::__construct($interactionService, $currentUser);
$this->interactionRepository = $interactionRepository;
}
public function index(?int $count = null)
{
return response()->json($this->interactionRepository->getRecentlyPlayed($this->currentUser, $count));
}
}