koel/app/Http/Controllers/API/Interaction/PlayCountController.php

18 lines
497 B
PHP
Raw Normal View History

2017-08-06 09:43:59 +00:00
<?php
namespace App\Http\Controllers\API\Interaction;
use App\Events\SongStartedPlaying;
use App\Http\Requests\API\Interaction\StorePlayCountRequest;
2017-08-06 09:43:59 +00:00
class PlayCountController extends Controller
{
public function store(StorePlayCountRequest $request)
2017-08-06 09:43:59 +00:00
{
2022-06-10 10:47:46 +00:00
$interaction = $this->interactionService->increasePlayCount($request->song, $this->user);
event(new SongStartedPlaying($interaction->song, $interaction->user));
2017-08-06 09:43:59 +00:00
return response()->json($interaction);
}
}