I am trying to keep my uploaded image into public_html/storage/post/
. but now this code not working for me and upload into the direct public_html/
$image = $request->file('image');
$slug = str_slug($request->title);
if(isset($image))
{
// make unipue name for image
$currentDate = Carbon::now()->toDateString();
$imageName = $slug.'-'.$currentDate.'-'.uniqid().'.'.$image->getClientOriginalExtension();
if(!Storage::disk('public')->exists('post'))
{
Storage::disk('public')->makeDirectory('post');
}
$postImage = Image::make($image)->save($imageName);
Storage::disk('public')->put('post/'.$imageName,$postImage);
} else {
$imageName = "default.png";
}