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

Custom resource pages #5

Closed
wants to merge 2 commits into from
Closed

Custom resource pages #5

wants to merge 2 commits into from

Conversation

andreia
Copy link
Contributor

@andreia andreia commented Sep 28, 2024

When overriding the resource class, point the resource's Create, Edit, and List WebhookCall pages to the overriding class.

Issue #4

Copy link

@willcastillo willcastillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @andreia ! Really appreciate this!

It should work... however, I wasn't expecting a change like this. Truth be told, I didn't dig enough when I reported it. I did it after your PR though.

What are your thoughts on this? The root cause seems like an architectural issue with how the related resource is defined on the child pages and further referenced. Would it be a referenced using a callable method instead of directly using the static variable, we wouldn't need to parse names and make decisions on naming conventions the users uses (like, having a resource with "Resource" on its name, for instance).

Moreover, we'll need to duplicate this parser on every level of the hierarchy in order to truly honor inheritance (otherwise, only the first -yours- and last node would be honored).

Am I over complicating this? idk, I have the feeling this is more of a Filament issue, not your plugin.

@willcastillo
Copy link

After playing a couple of hours, I do believe this is a larger issue, one I don't think is even worth fixing. In order to "solve" this, we'd need to make fundamental changes to how a resource and its child pages are linked together.

It'd be much easier to solve it through education: Adding to the Filament documentation that in order to override a resource, you'd probably need to also override its child pages as well and update the getPages() method of the new resource. Probably adding a filament command? make:filament-resource-override maybe?

Anyway... Sorry for pulling the trigger too fast on this one!

@andreia
Copy link
Contributor Author

andreia commented Sep 30, 2024

No problem :)

@andreia andreia closed this Sep 30, 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