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

18 lines
502 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
{
2018-08-18 12:27:26 +00:00
$interaction = $this->interactionService->increasePlayCount($request->song, $request->user());
event(new SongStartedPlaying($interaction->song, $interaction->user));
2017-08-06 09:43:59 +00:00
return response()->json($interaction);
}
}