mirror of
https://github.com/koel/koel
synced 2024-12-26 04:23:05 +00:00
22 lines
605 B
PHP
22 lines
605 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Interaction;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\API\SongLikeRequest;
|
|
use App\Models\User;
|
|
use App\Services\InteractionService;
|
|
use Illuminate\Contracts\Auth\Authenticatable;
|
|
|
|
class LikeController extends Controller
|
|
{
|
|
/** @param User $user */
|
|
public function __construct(private InteractionService $interactionService, private ?Authenticatable $user)
|
|
{
|
|
}
|
|
|
|
public function store(SongLikeRequest $request)
|
|
{
|
|
return response()->json($this->interactionService->toggleLike($request->song, $this->user));
|
|
}
|
|
}
|