Hello friends, i have form with image upload i need to save the image in table database when i create new offer .Any help!
this is the code:
<div class="grid grid-cols-1 mt-5 mx-7">
<label for="file" class="uppercase md:text-sm text-xs text-gray-500 text-light font-semibold">Image</label>
<div class="max-w-md mx-auto rounded-lg overflow-hidden md:max-w-xl">
<div class="md:flex">
<div class="w-full p-3">
<div class="relative border-dotted h-48 rounded-lg border-2 border-cyan-700 bg-gray-100 flex justify-center items-center">
<div class="absolute">
<div class="flex flex-col items-center "> <i class="fa fa-folder-open fa-4x text-blue-700 "></i> <span class="block text-gray-400 font-normal">Attach you image here</span> </div>
</div> <input type="file" class="h-full w-full opacity-0" name="">
</div>
</div>
</div>
</div>
</div>
and this is the controller function:
public function store()
{
request()->validate([
'name' => 'required|string|max:40',
'description' => 'required|string|max:255',
'job_photo_path' => 'required'
]);
$jobOffer = jobOffer::create([
'name' => request('name'),
'description' => request('description'),
'job_photo_path' => request('job_photo_path'),
]);
return redirect('/jobOffer');
}