koel/app/Http/Controllers/API/ScrobbleController.php

24 lines
571 B
PHP
Raw Normal View History

2016-05-30 05:50:59 +00:00
<?php
namespace App\Http\Controllers\API;
use App\Models\Song;
2017-05-01 17:49:44 +00:00
use Illuminate\Http\Request;
2016-05-30 05:50:59 +00:00
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.
2016-05-30 05:50:59 +00:00
*
* @return \Illuminate\Http\JsonResponse
*/
public function store(Request $request, Song $song, $timestamp)
2016-05-30 05:50:59 +00:00
{
return response()->json($song->scrobble($request->user(), $timestamp));
2016-05-30 05:50:59 +00:00
}
}