This function can be used to crop https://github.com/Intervention/image with custom background color.
I found that if your crop with Intervention Image include region outside of the image to be cropped, you will get black colors on those areas. This function provided here which requires inclusion of the https://github.com/Intervention/image project, lets you perform such crops with a custom/transparent color.