Repeaters... How to feed them custom data?
So below i have the following code which reports the following display. I cannot use relationships on the "front end" due to how we are using tennants
24 Replies
On the "front end" i had to use a Section instead of the repeater...
And the output looks like this. I would like to use the repeater as it has a better look. Anyway i can feed it custom data and not use the relationships?
Why do you need a repeater for this. The same layout can be accomplished with a section or even just a grid layout component. All layout component support relationships.
I guess I'm not understanding.
Well we have an admin panel, and a "regular" panel i guess or "app" for the front end thats using Tenants, When i do
->relationship('serverVariables')
we get Call to a member function serverVariables() on null
I'd like them to be formatted like the Repeater does, where they're in their own container boxes.
I guess the proper term would be styled, not formatted.
Fair. Just seems odd to use a repeater that doesn’t repeat. 😀
wdym? The repeater works as intended on the admin panel.
I would say if you’re getting the null message it’s because on the front end the record isn’t being set in mount or passed to the form.
The error is saying that the record is null.
Right, we are setting the "server" with
On the admin side, the record is the server.
And the front end is outside of the panel in its own livewire component?
Its it's "own" panel? not sure how to explain it. Like the admin panel is
/app/Filament/
then the "front end" is /app/Filament/App
So we have two "PanelProviders" ones called Admin other called AppHmm. Then I would expect it to be fine.
If you're bored... its all in this repo... https://github.com/pelican-dev/panel/tree/issue/353
And where should I be looking?
https://github.com/pelican-dev/panel/blob/issue/353/app/Filament/App/Pages/Startup.php#L78-L140 Is the file in question on the "App" the one that has no record/resource
Could we get the resource/record from the url? the servers has a server_id column and its in the url, so
/app/3/startup
is server with the server_id of 3Ah, ok. Yea, simple page isn’t going to automatically set the record like the EditRecord class does. Have a look at how it’s being done in the EditRecord class. That should give you some insight. The SimplePage is still just a livewire component so following this should help you to get there. https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#setting-a-form-model
You shouldn’t need to get the record inside each of the field formatStateUsing() methods. It should be set in the mount then passed to the $form->model() method.
Okay. Im not the one whom made the "simple" pages and everything. My scope of programming and how filament works is more of a going with the flow.
Okay, i'll pass it on to the other guys and we can see what we can figure out, thanks!
No worries. Just trying to give you some direction.
Following that page, I've added
and when adding
public Post $post;
above the form function i get thisIt has to be inside the class
Object of class Valet\Server could not be converted to string
I might just leave it alone, getting deep into the "idk what im doing" territoryOk, if it’s looking for Valet\Server then there’s definitely something you’re doing wrong.
Just report back what I shared and go from there.