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

22 lines
473 B
PHP
Raw Normal View History

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