I'm using Image Intervention in my project.
My application working smoothly while uploading small size images. But when I try to upload large size image(>2mb), my application stops working!
Even It shows no proper errors. Sometimes It shows Token mismatch
error & sometimes the url not redirects.
How to fix it? I've no idea.
Here is my code:
$post->new Post();
if($request->hasFile('image')){
$image=$request->file('image');
$filename=Auth::user()->id.'_'.time().'.'.$image->getClientOriginalExtension();
$location=public_path('images/'.$filename);
Image::make($image)->save($location);
$post->image=$filename;
}
$post->save();
I'm using Image intervention
for uploading images. But you can suggest alternative of it as well.
Thanks!