koel/app/Http/Controllers/API/Interaction/PlayCountController.php
2020-10-26 16:29:29 +01:00

17 lines
504 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, $this->currentUser);
event(new SongStartedPlaying($interaction->song, $interaction->user));
return response()->json($interaction);
}
}