koel/app/Http/Controllers/API/ScrobbleController.php
2017-05-02 00:49:44 +07:00

23 lines
571 B
PHP

<?php
namespace App\Http\Controllers\API;
use App\Models\Song;
use Illuminate\Http\Request;
class ScrobbleController extends Controller
{
/**
* Create a Last.fm scrobble entry for a song.
*
* @param Request $request
* @param Song $song
* @param string $timestamp The UNIX timestamp when the song started playing.
*
* @return \Illuminate\Http\JsonResponse
*/
public function store(Request $request, Song $song, $timestamp)
{
return response()->json($song->scrobble($request->user(), $timestamp));
}
}