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

22 lines
511 B
PHP
Raw Normal View History

2017-08-06 09:43:59 +00:00
<?php
namespace App\Http\Controllers\API\Interaction;
use App\Http\Requests\API\SongLikeRequest;
2017-08-06 09:43:59 +00:00
use Illuminate\Http\JsonResponse;
class LikeController extends Controller
{
/**
* Like or unlike a song as the currently authenticated user.
*
* @param SongLikeRequest $request
2017-08-06 09:43:59 +00:00
*
* @return JsonResponse
*/
public function store(SongLikeRequest $request)
2017-08-06 09:43:59 +00:00
{
2018-08-18 12:27:26 +00:00
return response()->json($this->interactionService->toggleLike($request->song, $request->user()));
2017-08-06 09:43:59 +00:00
}
}