GithubHelp home page GithubHelp logo

Comments (2)

janhartigan avatar janhartigan commented on June 9, 2024

Hmm...at the moment has_one and has_many relationships are not supported. I spent a lot of time thinking about this initially and came to the conclusion that you can do just about everything you need to with just belongs_to and has_many_and_belongs_to. If there is a user_id on the profiles table, you should create a user relationship field in the profiles model (which would be a belongs_to relationship). Then when you create a profile, you select the user from the dropdown.

I've been thinking a lot about how to manage has_many and has_one relationships, but it's a pretty tricky problem. This stems from the fact that you'd need to create an entry on another table in order to get it working properly. This would mean forms inside forms, and that adds a layer of complexity that is a bit beyond where this bundle is at the moment (and thankfully it's not totally necessary if you plan around it).

Let me know if you have any other questions!

edit: incidentally, I also realize that if it's not supported, the label also shouldn't show up. It would also be nice, possibly, if I raised an error making it very clear to the developer that the field isn't supported. All things to go on the todo list :)

from laravel-administrator.

Premke avatar Premke commented on June 9, 2024

Ohh... ok, thanks for clarifying it. I will plan around it with belongs_to relationship.

from laravel-administrator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.