Neeraj1005's avatar

production.ERROR: Undefined offset: 0 {"userId":74,"exception":"[object] (ErrorException(code: 0)

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');
    }
0 likes
4 replies
frankielee's avatar

try to dd($this->c_logo), check is this a valid file object.

Neeraj1005's avatar

@frankielee it showing the 'Null' with dd. I think it might be my server cpanel issue. Because yesterday my collegue made some changes.

thatguy312's avatar

I signed up here for the fact I've replicated this same error.

Working fine when APP_ENV is running "local"

I get this exact same error when APP_ENV is running "production"

For the moment, I've had to set my APP_ENV to "local" to fix the problem, but also looking for answers.

Please or to participate in this conversation.