You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a multi-language application and need to replace the standard single alt field in the Media Edit Form (both in the main Resource page and the Picker modal) with a translatable field using a JSON column (alts_json).
Environment Details
Filament Version: v4 (Latest)
Filament Curator Version: v4 (Latest)
Custom Model Used: Yes, App\Models\MediaCurator extending Awcodes\Curator\Models\Media.
Implementation Steps & Observed Behavior
I have successfully configured my custom model and Schema bindings, using the Service Provider's binding mechanism to point to my custom classes:
Custom Model Bound:config('curator.model') points to App\Models\MediaCurator::class.
Custom Schema Bound:config('curator.resource.schemas.form') points to App\Filament\Admin\CustomCurator\Resources\Media\Schemas\CustomMediaForm::class.
Custom Code: My CustomMediaForm extends Awcodes\Curator\Resources\Media\Schemas\MediaForm.
My goal is to override the getAdditionalInformationFormSchema() method in my custom Schema class:
// In App\Filament\Admin\CustomCurator\Resources\Media\Schemas\CustomMediaForm.phppublicstaticfunctiongetAdditionalInformationFormSchema(): array
{
// ... My custom logic to replace the single 'alt' field with a multi-tab JSON field ...
}
Observed Behavior (The Sticking Point):
When diagnosing the execution flow:
A temporary dd() placed inside my custom CustomMediaForm::getAdditionalInformationFormSchema() DOES NOT execute when opening the Media Resource or the Picker Modal.
However, placing the same temporary dd() inside the original vendor method (Awcodes\Curator\Resources\Media\Schemas\MediaForm::getAdditionalInformationFormSchema()) DOES execute, and the page loads.
This behavior suggests that while the Dependency Injection Binding correctly points to my class, the execution logic seems to resolve to the parent class's static method via Late Static Binding, effectively bypassing the override.
Question
The issue appears to be that the static method resolution within the Livewire component is not correctly applying Late Static Binding, resulting in the parent's method being executed.
Given the current setup, what is the recommended and most robust way in Curator v4 to ensure that the form logic correctly executes the derived static method in my CustomMediaForm and loads my custom form fields? Which specific hook or configuration should be used to guarantee my custom form fields are loaded?
Thank you for your time and assistance!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Context
I am building a multi-language application and need to replace the standard single
altfield in the Media Edit Form (both in the main Resource page and the Picker modal) with a translatable field using a JSON column (alts_json).Environment Details
App\Models\MediaCuratorextendingAwcodes\Curator\Models\Media.Implementation Steps & Observed Behavior
I have successfully configured my custom model and Schema bindings, using the Service Provider's binding mechanism to point to my custom classes:
config('curator.model')points toApp\Models\MediaCurator::class.config('curator.resource.schemas.form')points toApp\Filament\Admin\CustomCurator\Resources\Media\Schemas\CustomMediaForm::class.CustomMediaFormextendsAwcodes\Curator\Resources\Media\Schemas\MediaForm.My goal is to override the
getAdditionalInformationFormSchema()method in my custom Schema class:Observed Behavior (The Sticking Point):
When diagnosing the execution flow:
A temporary dd() placed inside my custom CustomMediaForm::getAdditionalInformationFormSchema() DOES NOT execute when opening the Media Resource or the Picker Modal.
However, placing the same temporary dd() inside the original vendor method (Awcodes\Curator\Resources\Media\Schemas\MediaForm::getAdditionalInformationFormSchema()) DOES execute, and the page loads.
This behavior suggests that while the Dependency Injection Binding correctly points to my class, the execution logic seems to resolve to the parent class's static method via Late Static Binding, effectively bypassing the override.
Question
The issue appears to be that the static method resolution within the Livewire component is not correctly applying Late Static Binding, resulting in the parent's method being executed.
Given the current setup, what is the recommended and most robust way in Curator v4 to ensure that the form logic correctly executes the derived static method in my CustomMediaForm and loads my custom form fields? Which specific hook or configuration should be used to guarantee my custom form fields are loaded?
Thank you for your time and assistance!
Beta Was this translation helpful? Give feedback.
All reactions