See if this episode helps:
https://laracasts.com/series/livewire-3-from-scratch/episodes/24
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Need help with livewire, am frustrated af. Whenever i would try to upload a file, i'll get an error Trying to access array offset on null and when i look at the body of the error window i see this.
{
"_token": "HoNkivgDRTzYnjNKfVDp3hbtO1x29YduoRNhgbzB",
"components": [
{
"snapshot": "{"data":{"issue":[{"type":[[],{"s":"arr"}],"attachments":[[],{"s":"arr"}],"occuredAt":null,"confidentiality":null,"description":null,"desiredResolution":null},{"s":"arr"}]},"memo":{"id":"xr5k4jMD6WwsQfooFBq4","name":"employee.issues.create-issue","path":"employee/relations/issues/create","method":"GET","children":[],"scripts":["103409577-0"],"assets":[],"errors":[],"locale":"en"},"checksum":"9292ffaf024f10a813f6521eb8dd63d1e57f823c4b78c37994dc2c10832af38b"}",
"updates": [],
"calls": [
{
"path": "",
"method": "_uploadErrored",
"params": [
"issue.attachments",
"
nWarning: File upload error - unable to create a temporary file in Unknown on line 0
n{"message":"The files.0 failed to upload.","errors":{"files.0":["The files.0 failed to upload."]}}",
true
]
}
]
}
]
}
i suspect that for some reason the file is just being lost when uploading and so when livewire tries to upload to temporary directory livewire-tmp i get this trying to access array on null. When i check the permissions for the folder, it seems that i have full control. What could be wrong here? This is the code.
<input type="file" wire:model="issue.attachments" multiple>
class className extends Component
{
use WithFileUploads;
public $issue = [
// other props
'attachments' => [],
];
Please or to participate in this conversation.