getUrl() Method not working on Model

Good morning. Hoping someone might have some insight, I can't find a clear answer with search. I'm trying to pre-fill a Placeholder with a link to another model's view resource, but I'm getting an error that I can't use my Organizations::getUrl() method. Forms\Components\Placeholder::make('Company Link') ->hidden(fn (Get $get) => $get('organization_id') == '') ->label('Company Link') ->content(function (Opportunities $record): string { $organization = Organizations::find($record->organization_id); // get a URL to the record view page return Organizations::getUrl('edit', ['record' => $organization]); }) Error: Call to undefined method App\Models\Organizations::getUrl() I just updated to the latest version (v3.2.81) and the issue persists. Organizations is already used on this form for a select without issue, it's just the getUrl() method that's not working.
3 Replies
Dennis Koch
Dennis Koch2mo ago
Good morning. Please read #✅┊rules
toeknee
toeknee2mo ago
Because you need to call the resource not the model.
WessBechard
WessBechard2mo ago
Oh wow, that's a giant face-palm. Thanks. Obviously OrganizationsResource::getUrl() is working 🙂
Want results from more Discord servers?
Add your server
More Posts
how to create two filament resource that corresponds to one model?I have this table named taxonomies with following fields. ``` $table->id(); $table->string('name');Conditional validation on field in a repeaterHi all, I have some difficulties to run validation on fields in repeater fields... So, let me explaiTarget class [filament] does not exist. ?Why am I getting this error when I try to send a get request from PostMan? Everything is installed pHow to Access image in filament if I want to modify that .How to Access image in filament if I want to modify that like I am trying to upload image on BunnyCDCalling $wire.$id inside custom form element returns the whole form ID and not only the element.I am trying to use `$wire.$call('myFunction')` from inside a custom form component, but I get `UnablResource vs Page for Stock Management & Reporting?Hi there, I am quite new to Filament and now have to build a Stock Management & Reporting view for mIs there anyway to reload RelationManager Owner page with Spa mode?In my CreateAction of the RelationManager, I have update some ower model data, I then want it to refIssues with scrolling relationship manager modal on IOS DevicesHi everyone, Hoping someone has had this issue as well 🙂 I've followed the pre-issue report guidemultiple() select not work with afterStateUpdatedgenerate attribute values based on the selected attributes and add them into the repeaterAnimation On Action Buttonhi all , i have a question . is that possible to add animation trigger on action button ? example li