Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

flssol's avatar
Level 4

Adding custom headers to upload-file request

Is there a way to add headers to upload-file request? Currently I am adding tenant tag to all Livewire requests like so:

import { Livewire } from '../../../vendor/livewire/livewire/dist/livewire.esm';

Livewire.hook('request', ({ uri, options, payload, respond, succeed, fail }) => {

    var tenantTag = document.head.querySelector('meta[name="tenant"]');

    if(tenantTag) {
        options.headers['X-Tenant'] = tenantTag.content;
    }
});

But the upload mechanism is different from a "regular" LW request.

0 likes
1 reply
Michael_K's avatar

Pushing that question, because I have the same problem now.

Please or to participate in this conversation.