koel/app/Http/Controllers/API/Interaction/PlayCountController.php
2020-09-14 00:04:07 +02:00

17 lines
502 B
PHP

<?php
namespace App\Http\Controllers\API\Interaction;
use App\Events\SongStartedPlaying;
use App\Http\Requests\API\Interaction\StorePlayCountRequest;
class PlayCountController extends Controller
{
public function store(StorePlayCountRequest $request)
{
$interaction = $this->interactionService->increasePlayCount($request->song, $request->user());
event(new SongStartedPlaying($interaction->song, $interaction->user));
return response()->json($interaction);
}
}