actually $request->hasFile('image') return true if your file field not empty
make sure that your request->file should empty if you are not selecting any file
try with this and see if your file field have the image
dd($request-all())
when it fails to add data, why does the file upload even though it has been conditioned,
this is an example of my condition code:
if ($request->hasFile('image')) {
$image = $request->file('image')->store('assets/images/highlighs');
} else {
$image = 'assets/images/highlighs/default.jpg';
}
$highlight->image = $image;
guess what is missing or wrong? thank you
Please or to participate in this conversation.