Skip to content

Conversation

RahulDey12
Copy link

@RahulDey12 RahulDey12 commented May 14, 2020

Fix against #199
New Syntax Should Be Like

Post:
    title: string:400
    published_at: timestamp nullable
    relationships:
      morphMany: Comment

  Comment:
    title: string
    relationships:
      morphTo: null

@RahulDey12 RahulDey12 changed the title added Polymorphic Relationship #199 Added Polymorphic Relationship May 14, 2020
@jasonmccreary
Copy link
Collaborator

I don't understand the morphTo: null in your example. Why would you define something this way?

Also, I am glad to help with the tests, but what is the expected output for each of the generated morph relationship methods?

@RahulDey12
Copy link
Author

morphTo: null Because of no class required for morphTo

@jasonmccreary
Copy link
Collaborator

jasonmccreary commented May 14, 2020

Again, examples of the expected output would be appreciated or links to the docs so I can determine what code this generates so it can be properly tested.

Otherwise, I will not be able to merge. As it stands, I will not use null as a value.

@RahulDey12
Copy link
Author

image
image
image

@RahulDey12
Copy link
Author

also, you can check by installing my forked repo

@jasonmccreary
Copy link
Collaborator

Alright, I'll take a look at the Laravel docs and rework this accordingly.

In the future, I would encourage you to include the related information in your pull requests to make it easier on the maintainers of the open source project to understand and verify your changes. This will also give your contribution a better chance at being accepted.

@RahulDey12
Copy link
Author

RahulDey12 commented May 14, 2020

@jasonmccreary But it is working

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

Successfully merging this pull request may close these issues.

2 participants