2018-10-20 21:46:12 +00:00
|
|
|
<?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;
|
2018-10-20 21:46:12 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2018-10-20 21:46:12 +00:00
|
|
|
$this->interactionRepository = $interactionRepository;
|
|
|
|
}
|
|
|
|
|
2020-10-26 15:29:29 +00:00
|
|
|
public function index(?int $count = null)
|
2018-10-20 21:46:12 +00:00
|
|
|
{
|
2020-10-26 15:29:29 +00:00
|
|
|
return response()->json($this->interactionRepository->getRecentlyPlayed($this->currentUser, $count));
|
2018-10-20 21:46:12 +00:00
|
|
|
}
|
|
|
|
}
|