koel/app/Http/Controllers/API/Interaction/RecentlyPlayedController.php
Phan An 6f0db1620f
Add "Recently Played" playlist (#839)
* Add "Recently Played" playlist

* Apply fixes from StyleCI (#838)
2018-10-20 23:46:12 +02:00

23 lines
686 B
PHP

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