toggleLike() public static method

Like or unlike a song on behalf of a user.
public static toggleLike ( string $songId, User $user ) : Interaction
$songId string
$user User
return Interaction
Ejemplo n.º 1
0
 /**
  * Like or unlike a song as the currently authenticated user.
  *
  * @param Request $request
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function like(Request $request)
 {
     return response()->json(Interaction::toggleLike($request->input('song'), $request->user()));
 }