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;
2017-04-29 06:06:36 +00:00
use Illuminate\Http\Request;
2016-05-30 05:50:59 +00:00
use App\Models\Song;
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
}
}