सबसे पहले आप enctype="multipart/form-data"
. बदलें enctype="mutlipart/form-data"
. के बजाय अपने फॉर्म में।फिर इस कोड को अपने कंट्रोलर के पास रखें
public function store(Request $request)
{
if($request->hasFile('logo')) {
$img_ext = $request->file('logo')->getClientOriginalExtension();
$filename = 'company-logo-' . time() . '.' . $img_ext;
$path = $request->file('logo')->move(public_path(), $filename);//image save public folder
}
//You should store only filename not path in db
Company::create([
'name' => $request->name,
'email' => $request->email,
'logo' => $filename,
'website' => $request->website
]);
return redirect('/company/all');
}