mirror of
https://github.com/koel/koel
synced 2024-12-22 02:23:14 +00:00
23 lines
495 B
PHP
23 lines
495 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers\API\Interaction;
|
||
|
|
||
|
use App\Models\Interaction;
|
||
|
use Illuminate\Http\JsonResponse;
|
||
|
use Illuminate\Http\Request;
|
||
|
|
||
|
class LikeController extends Controller
|
||
|
{
|
||
|
/**
|
||
|
* Like or unlike a song as the currently authenticated user.
|
||
|
*
|
||
|
* @param Request $request
|
||
|
*
|
||
|
* @return JsonResponse
|
||
|
*/
|
||
|
public function store(Request $request)
|
||
|
{
|
||
|
return response()->json(Interaction::toggleLike($request->song, $request->user()));
|
||
|
}
|
||
|
}
|