我正在尝试使用Laravel制作图像裁剪器。我有以下工作的PHP代码来做到这一点,但任何人都可以请告诉我如何使用Laravel实现相同的目标?
$dst_x = 0;
$dst_y = 0;
$top = 15;
$left = 230;
$width = 200;
$height = 200;
$dst_image = imagecreatetruecolor($width, $height);
$src_image = imagecreatefromjpeg('public/upload/' . $filename);
imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $left, $top, $width, $height, $width, $height);
$random_name = rand() . ".jpg";
imagejpeg($dst_image, 'public/upload' . $random_name);