Level 24
That code doesn't upload an image - you need to show more code
This code given below uploads the image but when i try to upload audio(mp3) it gives me error undefined variable audio
public function store(Request $request)
{
if($request->hasFile('audio')){
$audio = $request->file('audio')->store('music');
}
Music::create([
'title'=>$request->title,
'description'=>$request->description,
'audio'=>$audio
]);
return redirect()->back();
}
Can anybody help to upload audio. Thanks
Please or to participate in this conversation.