We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
Trying to upload the image and resize it on upload.
Model (Profile):
`use HasImageUploads;
protected static $imageFields = [ 'avatar' => [ [ 'width' => 300, 'height' => 300, 'crop' => false, 'placeholder' => 'http://placehold.it/300x300', 'rules' => 'image|max:2000', ] ] ];`
Controller: `public function uploadAvatar(Request $request, User $user){
$request->validate([ 'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048', ]); $image = $request->file('image'); $user->profile->uploadImage($image, 'avatar'); return response()->json(['url'=>$user->profile->avatar], 200); }`
But as a result I'm getting full-size image. What am I doing wrong? Any suggestions appreciated :)
Thanks in advance :)
The text was updated successfully, but these errors were encountered:
Hi, If you are looking for something like Laravel Imager Happy to help.
Sorry, something went wrong.
No branches or pull requests
Hi!
Trying to upload the image and resize it on upload.
Model (Profile):
`use HasImageUploads;
Controller:
`public function uploadAvatar(Request $request, User $user){
But as a result I'm getting full-size image. What am I doing wrong? Any suggestions appreciated :)
Thanks in advance :)
The text was updated successfully, but these errors were encountered: