Level 29
try to dd($this->c_logo), check is this a valid file object.
In my app file upload gives me an error while in my localhost its running properly. can anyone tells me what this error means?
[2021-08-06 09:23:41] production.ERROR: Undefined offset: 0 {"userId":74,"exception":"[object] (ErrorException(code: 0): Undefined offset: 0 at /home/myDomainName/public_html/myProjectName/vendor/livewire/livewire/src/WithFileUploads.php:37)
[stacktrace]
store code
public function store()
{
$data = $this->validate() + ['user_id' => auth()->id()];
if ($this->c_logo) {
$data['c_logo'] = $this->c_logo->storePublicly('companyLogo', 'public');
}
Company::create($data);
session()->flash('success', 'company added successfully.');
return redirect()->route('companies.index');
}
Please or to participate in this conversation.