koel/app/Http/Controllers/API/Interaction/LikeController.php
2018-08-18 14:27:44 +02:00

21 lines
511 B
PHP

<?php
namespace App\Http\Controllers\API\Interaction;
use App\Http\Requests\API\SongLikeRequest;
use Illuminate\Http\JsonResponse;
class LikeController extends Controller
{
/**
* Like or unlike a song as the currently authenticated user.
*
* @param SongLikeRequest $request
*
* @return JsonResponse
*/
public function store(SongLikeRequest $request)
{
return response()->json($this->interactionService->toggleLike($request->song, $request->user()));
}
}