koel/app/Http/Controllers/API/Interaction/BatchLikeController.php
2018-08-29 13:15:23 +07:00

28 lines
761 B
PHP

<?php
namespace App\Http\Controllers\API\Interaction;
use App\Http\Requests\API\BatchInteractionRequest;
class BatchLikeController extends Controller
{
/**
* Like several songs at once as the currently authenticated user.
*/
public function store(BatchInteractionRequest $request)
{
$interactions = $this->interactionService->batchLike((array) $request->songs, $request->user());
return response()->json($interactions);
}
/**
* Unlike several songs at once as the currently authenticated user.
*/
public function destroy(BatchInteractionRequest $request)
{
$this->interactionService->batchUnlike((array) $request->songs, $request->user());
return response()->json();
}
}