bref icon indicating copy to clipboard operation
bref copied to clipboard

Add header explanation for Laravel Nova

Open CodeTechNL opened this issue 3 years ago • 6 comments

I've been searching why my Laravel Nova wasn't working. Some extra explanation for the docs should help others out

CodeTechNL avatar Aug 10 '22 01:08 CodeTechNL

In the file you modified, we already have a list of "other headers": https://github.com/brefphp/bref/blob/master/docs/frameworks/laravel.md?plain=1#L181-L182

Shouldn't we add the X-Inertia in the same list?

afu-dev avatar Aug 10 '22 07:08 afu-dev

@afu-dev I’ve added it as optional. Not everyone uses Nova or Inertia. There is a limit of 9 (if I’m right) on the forwarded headers.

CodeTechNL avatar Aug 10 '22 08:08 CodeTechNL

Likewise, not everyone uses Livewire. I propose to have all optional headers in the same place instead of one in the forwardedHeaders list and one underneath the source code.

Indeed, the forwardedHeaders list is limited (to 10 headers, ref: https://github.com/getlift/lift/blob/master/docs/server-side-website.md?plain=1#L365), and adding everything to it will break the code. Maybe a note like you did with "if you use this, add this header, if you use that, add that header"?

(Again, just a proposition to be extra clear with everyone reading the doc 😉)

afu-dev avatar Aug 10 '22 08:08 afu-dev

I agree on it @afu-dev, I’ll update it later today and change livewire too. Also I’ll add a notice about the limit of 10 forwardedHeaders

CodeTechNL avatar Aug 10 '22 08:08 CodeTechNL

Thanks for the PR, and good points here!

How about adding it to the list, but commented (with a comment above saying "uncomment if you use Nova"). We could even do the same thing for the Livewire header (commented by default), that way we avoid hitting the limit of 10 headers too easily?

mnapoli avatar Aug 10 '22 09:08 mnapoli

@mnapoli ill see what’s the best to keep it clear and brief and update my PR

CodeTechNL avatar Aug 10 '22 09:08 CodeTechNL

@mnapoli little bit late, kinda busy. Updated as requested

CodeTechNL avatar Aug 21 '22 16:08 CodeTechNL

Thank you both for contributing!

mnapoli avatar Sep 13 '22 14:09 mnapoli