typed property $table must not be accessed before inicialization
According to Dan Harrin https://discord.com/channels/883083792112300104/956270111176679516/1191874067788202034, maybe there is something wrong in my code. To avoid flooding offtopic channel, I share the code here to ask for help and see if it's a bug or not. If so,I will open the issue on github. Anyway thanks.
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
21 Replies
1. I made a filament custom pageI have a filament custom. Its function is to render a livewire component:
2. the respective view:
havent read ur question, but i recommend u to name everything in English
\App\Models\Usuario
just call it User
, not Usuario
? also Solicitacao
and other stuff, i just recomend to u to use engHello man 🙂
A few days ago I decided to translate a code into English. Then the guy who came to offer help threw a bunch of sh** at me, because I made a typo in the name of a variable or something like that i dont remember anymore.
I told him that I had translated the code to make it easier to helpers.
Then he said to me: Don't translate. Post your code as it is.
Note: regarding coding directly in English, I am not authorized.
But yes, I can translate the code without any problems, but for the case in question, I think it will be irrelevant.
a year ago i was in a company that wanted all in spanish. so they yelled at me cuz of that. but i didnt give a shit, i code in english, then i translate the strings to the final user to the desired language. finally, after months, they said i was right. im not saying to u what to do, just what i did (:
and yeah this is not relevant to the question but relevant to code.
and for the typos, just check it? idk english 100% neither 🤷♂️ i google to translate sometimes some words, its fine
Use whatever language you want.
My question is why are you using a livewire component in the blade file that is the same name as the $view property of the page. I think you’re creating a circular reference.
In filament pages are livewire components.
The livewire component has x.blade name. The filament view is named as view-x.blade.
Also if you’re extending a livewire component, like a page you will want to call parent::mount() in your mount method.
Ok, then the issue is in your livewire component, but you haven’t shared any code relating to the lW component that the page is trying to render.
Its more then 2k letters.. trying to .. its posted as a file but file sux
😄
Share it in a gist
Nobody want to download it to read.. haha
1 sec
If it’s. In a gist we don’t have to download anything and it’s syntax highlighted. 🙂
Just share the link.
Looking for the code for this component by the way:
@livewire('retira-unidade-arquivamento')
I still think you’re trying to use the page component as the page’s content
The livewire component
https://gist.github.com/fcno/b397d69ee04f513e8e36dd18ebf39fe6
the related livewire view component
Can you share the flare link for the error? You scrolled down to quickly in the video you posted.
sure
Flare
Typed property App\Livewire\RetiraUnidadeArquivamento::$table must not be accessed before initialization - The error occurred at http://vmdcode01.sjes.gov.br:8083/gerencia/atendimento/retirada
Ok here’s the issue. You’re trying to filter a table based on a form that isn’t initialized yet. There’s a reason that forms and filters are separate things. What you need is a table filter not a separate form.
If you need to use a form you’ll have to set it up to modify the query string instead of trying to get the form state in the table.
I'm using form coz i need somehow, apply some validation to the input. Only when the input is valid, the table data must be filled.
Thx for your help man.
Filters are still just forms, you should be able to apply validation to them, iirc.
I tried it previously, but for some reason that i really dont remember, it didn't work as expected.
I will try this approach again.
Thank you again very much for your kindness.