-
Notifications
You must be signed in to change notification settings - Fork 95
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
Resource Override Functionality #219
base: 2.x
Are you sure you want to change the base?
Conversation
…se resource was hardcoded in these pages. Updated to take config, then default to the resource classes
The best way to extend is not this. |
Just tried this now. It still wont work. To override the table() and form() functions, I also have to extend the pages such as ListPage and CreatePage just to change the namespace of the resource. Which could be avoided with this PR? |
Other functions can be overridden fine, just not these 2 functions |
Do you have a repo I can see what you have done? |
Sadly not as it's in a private work repo. As best to describe it: Then I had to create a directory RoleResource/Pages then created ListRoles.php and that extends the package page for ListRoles. So that the this then allowed me to modify the public static function table() in the App\Filament\Resource\RoleResource::class to add extra fields. |
After extending ListRoles of the package
Property within your ListRoles class |
I don't think you'll need to extend the pages at all. |
I’m also experiencing this issue. Will this pull request be processed? |
The thing in the page is where resource is defined. And its hard set to the package resource class. So currently I do have to extend them to replace the $resource definition. |
When defining a resource in the config to extend, the form and table functions would not detect any changes.
Each page from the resource was hardcoded to take the resource class, I've changed to take the config class before defaulting back to the resource class from the package.