-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapping a JSON field within a Panel causes the panel to be hidden #2
Comments
There are a couple of way to solve this without changing the code
Panel::make('Brand Settings',
JSON::make('brand_settings', [
Image::make('Logo')->disk('public'),
Color::make('Primary Color')->swatches(),
Color::make('Secondary Color')->swatches(),
]),
),
Panel::make('Brand Settings', [
Text::make('Field'),
...JSON::make('brand_settings', [
Image::make('Logo')->disk('public'),
Color::make('Primary Color')->swatches(),
Color::make('Secondary Color')->swatches(),
]),
]), added section to readme.md #4 |
@elijahworkz I tested both approaches and none of them worked. First approach did throw errors related to the fact that the |
@Naoray you're right. I forgot to add that you need to get the property 'data' from the top JSON field. Like this:
Panel::make('Brand Settings',
JSON::make('brand_settings', [
Image::make('Logo')->disk('public'),
Color::make('Primary Color')->swatches(),
Color::make('Secondary Color')->swatches(),
])->data,
),
Panel::make('Brand Settings', [
Text::make('Field'),
...JSON::make('brand_settings', [
Image::make('Logo')->disk('public'),
Color::make('Primary Color')->swatches(),
Color::make('Secondary Color')->swatches(),
])->data,
]), |
@elijahworkz thanks. That works 🤝 |
The text was updated successfully, but these errors were encountered: