/** * @param $id * @return \Illuminate\Http\JsonResponse */ public function roleDelete($id, $artist) { $album = Album::with('Artist')->find($id); $album->artist()->detach($artist); $artist->save(); return response()->json(['status' => 'success']); }