I changed the image upload directory to the public folder, but why is the file uploaded to the database on the tmp path? I want the record name in the database to match the file name. Can anyone help?
Controller (store method)
public function store(Request $request)
{
$validatedData = $request->validate([
'banner_title' => 'required|max:255',
'image' => 'image|file|max:5120',
]);
$imageName = time() . '.' . $request->image->extension();
$request->image->move(public_path('images/banner-image'), $imageName);
Banner::create($validatedData);
return redirect('/dashboard/banner')->with('msg', 'Success!');
}