mirror of
https://github.com/koel/koel
synced 2025-01-01 23:38:43 +00:00
20 lines
594 B
PHP
20 lines
594 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers\V6\API;
|
||
|
|
||
|
use App\Events\SongStartedPlaying;
|
||
|
use App\Http\Controllers\API\Interaction\Controller;
|
||
|
use App\Http\Requests\API\Interaction\StorePlayCountRequest;
|
||
|
use App\Http\Resources\InteractionResource;
|
||
|
|
||
|
class PlayCountController extends Controller
|
||
|
{
|
||
|
public function store(StorePlayCountRequest $request)
|
||
|
{
|
||
|
$interaction = $this->interactionService->increasePlayCount($request->song, $this->user);
|
||
|
event(new SongStartedPlaying($interaction->song, $interaction->user));
|
||
|
|
||
|
return InteractionResource::make($interaction);
|
||
|
}
|
||
|
}
|