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