Skip to content
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

Fix relation names #428

Closed
wants to merge 1 commit into from
Closed

Fix relation names #428

wants to merge 1 commit into from

Conversation

Rattone
Copy link

@Rattone Rattone commented Jan 26, 2024

I tried the same relation "featuredImage" on a filament installation and by copying and pasting the code I get the Call to undefined method App\Models\Post::featured_image() error in a resource edit page with featured_image_id = null.

I tried the same relation "featuredImage" on a filament installation and by copying and pasting the code I get the `Call to undefined method App\Models\Post::featured_image()` error in a resource edit page with featured_image_id = null.
@Rattone
Copy link
Author

Rattone commented Jan 26, 2024

The error does not occur if featured_image_id is set, I don't understand if it is a filament or laravel bug but I would correct the documentation for those who have had this error like me

@Rattone
Copy link
Author

Rattone commented Jan 26, 2024

I would also suggest reversing the order of the changes to be made to Form component and Model, in my opinion it is more logical to do Model relation firsts (I might already have it) and then add the form component..

@awcodes
Copy link
Owner

awcodes commented Jan 29, 2024

The Readme is just an example for defining a relationship. Standard Laravel relationship conventions still apply, so, there is no right or wrong way to show in the readme. It is still up to the developer to have an understanding of what and how to use the relationships set up in their own apps.

Thank you, though. 😀

@awcodes awcodes closed this Jan 29, 2024
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