2017-08-06 09:43:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\API\Interaction;
|
|
|
|
|
|
|
|
use App\Events\SongStartedPlaying;
|
2017-12-09 18:34:27 +00:00
|
|
|
use App\Http\Requests\API\Interaction\StorePlayCountRequest;
|
2017-08-06 09:43:59 +00:00
|
|
|
|
|
|
|
class PlayCountController extends Controller
|
|
|
|
{
|
2017-12-09 18:34:27 +00:00
|
|
|
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);
|
2019-12-02 09:42:53 +00:00
|
|
|
event(new SongStartedPlaying($interaction->song, $interaction->user));
|
2017-08-06 09:43:59 +00:00
|
|
|
|
|
|
|
return response()->json($interaction);
|
|
|
|
}
|
|
|
|
}
|