mirror of
https://github.com/koel/koel
synced 2024-12-23 19:13:06 +00:00
22 lines
525 B
PHP
22 lines
525 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Interaction;
|
|
|
|
use App\Http\Requests\API\SongLikeRequest;
|
|
use App\Models\Interaction;
|
|
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(Interaction::toggleLike($request->song, $request->user()));
|
|
}
|
|
}
|