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

28 lines
760 B
PHP
Raw Normal View History

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