I want save uploaded file with original name.What i must add to this code?
Below's my code
public function store(Request $request)
{
if($request->hasFile('image'))
{
$file = $request->file('image');
$originalname = $file->getClientOriginalName();
$filename =$originalname;
$file->move('public/', $filename);
}
$path = $request->photo->store('images');... "The store method accepts the path where the file should be stored relative to the filesystem's configured root directory." Is$originalnamea path? Sounds more like a complete filename. "If you do not want a file name to be automatically generated, you may use the storeAs method, which accepts the path, file name, and disk name as its arguments"