Quadrubo / filament-model-settings

Model specific settings for your filament project.
MIT License
14 stars 2 forks source link

[Question]: Use settings in a resource page #6

Closed plantjes closed 7 months ago

plantjes commented 7 months ago

What happened?

Hi, can I use this for a specific resource? For example I have a schools model with the settings table column. In my school resource I want to add school specific field settings.

How to reproduce the bug

..

Package Version

1.0

PHP Version

8.1

Laravel Version

10

Which operating systems does with happen with?

No response

Notes

No response

Quadrubo commented 7 months ago

By design of the underlying package https://github.com/glorand/laravel-model-settings, the settings are stored in a json field. As you can use multiple settings, you'd have to create a form field for each of those.

What is your usecase, how do you expect the "school specific field settings" to work.

Maybe you can share the settings of the School model so I can imagine this better :)

plantjes commented 7 months ago

If I read the documentation then setting form fields are only possible on a specific settings page. What I want is adding setting form fields to a School resource (besides the normal form fields), so I can save specific settings for school ID 1 and can register default values

For example I have a School resource:

In my School model I only have 1 column with the json field "settings". I don't want a column for each setting field.

Quadrubo commented 7 months ago

I have implemented this in #8. It will be in the next release.

Quadrubo commented 7 months ago

This is implemented in release v1.1.0

plantjes commented 7 months ago

Thank you!