Skip to content

Backpack "Field Definition" Field 🤯 #22

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

Open
tabacitu opened this issue Dec 8, 2020 · 2 comments
Open

Backpack "Field Definition" Field 🤯 #22

tabacitu opened this issue Dec 8, 2020 · 2 comments

Comments

@tabacitu
Copy link
Member

tabacitu commented Dec 8, 2020

This is a little meta, but... I think it might be worth doing soon, because we can use it in multiple places. I think there are a number of ways to improve our Settings package, but one thing I would definitely like to improve is to enable the CREATE operation, so that a developer/admin can easily add a new entry.

The reason this hasn't been done is because just adding a setting, in production, doesn't make much sense. You also have to do stuff in code depending on that setting. And that's still true. But what if we:

  • enabled the CREATE operation, but only on localhost (by default)
  • made the CREATE operation easy-to-use, by allowing the dev to actually pick the field type they want to use, and a default value or smth, instead of having to copy-paste PHP code and turn it into JSON;
  • made the CREATE operation also output a seeder; so that if you add a setting in localhost, the seeder will also add it to production (optional, tick a box inside the create form to do that)
  • made two new operations - CopyOperation and PasteOperation operation, which would allow a dev/admin to Copy an entry from localhost, and Paste it to production (only inside the same CRUD, of course)

Right?! RIGHT?! I'm pretty excited about the prospect right now, but I'll let it settle for a while and maybe get feedback. Not sure this is something we should be spending our time on since the improvement in terms of dev time saved would be minor (you don't add settings that often), but... it's something I find really cool 😀

Anyway, if we had this "Backpack field" field, that lets you choose and define a field definition array, it would also be helpful inside the Backpack/DevTools package we're working on. You could create CRUDs from a GUI by picking which field types to show for each column type. Which... would save a lot more time than when we use it inside Settings.

Food for thought. Open to feedback.

@tabacitu tabacitu changed the title Backpack Field Field 🤯 Backpack "Field Definition" Field 🤯 Dec 8, 2020
@oddvalue
Copy link

I love this idea. I think we could definitely get some use out of it!

@ziming
Copy link

ziming commented Jan 9, 2021

Hmm i wonder if https://github.com/spatie/laravel-settings could be of use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants