did you add an enctype attribute to your form?
<form action="/some/url" method="post" enctype="multipart/form-data">
I am using intervention image and now I have doesn't work upload image. I don't now what's happened!
No error or anything, But doesn't upload it to table.
There my controller
Now i have two way upload avatar, But both of them doesn't work.
First:
$image_icon = $request->file('image_icon');
if($image_icon){
\File::delete(public_path() .'/upload/users/'.$user->image_icon.'-b.jpg');
\File::delete(public_path() .'/upload/users/'.$user->image_icon.'-s.jpg');
$tmpFilePath = 'upload/users/';
$hardPath = substr(0,100).'_'.time();
$img = Image::make($image_icon);
$img->save($tmpFilePath.$hardPath.'-b.jpg');
$img->fit(100, 100)->save($tmpFilePath.$hardPath. '-s.jpg');
$user->image_icon = $hardPath;
}
$icon = $request->file('user_icon');
if($icon){
$tmpFilePath = 'upload/users/';
$hardPath = str_slug($inputs['first_name'], '-').'-'.md5(time());
$img = Image::make($icon);
$img->fit(250, 250)->save($tmpFilePath.$hardPath.'-b.jpg');
$user->image_icon = $tmpFilePath.$hardPath.'-b.jpg';
}
My Migration
$table->string('image_icon')->nullable();
And my profile.blade
< I nput type="file" name="featured_image" id="input-file" >
< I nput type="file" name="user_icon" id="input-file">
I don't understanding where is error, Becosue when i save it all is as well...
But when i useing it in Laravel 5.2,5.3, 5.4 versions all was working.
Please or to participate in this conversation.