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 have a question regarding the usage of Filament Fabricator in conjunction with my Website and Page models.
In my Laravel project, I have a Website model that has a one-to-many relationship with the Page model. The Website belongs to a Real Estate Property. Here's a snippet of the relevant code:
class Website extends Model
{
use HasFactory;
publicfunctionproperty(): BelongsTo
{
return$this->belongsTo(Property::class);
}
publicfunctionpages(): HasMany
{
return$this->hasMany(Page::class);
}
}
Now, within my Page Resource, I've integrated Filament Fabricator with blocks like PropertyMap, PropertyDetailsTable, etc.
My challenge is populating these blocks with information from the associated Property Model.
I've attempted to achieve this in the Block's mutateData function. However, I'm unsure about the best approach to access the Property Model based on the Website to which the page belongs. The Website model has a property_id
Could you please provide guidance or advice on the most effective way to access the Property Model within the Filament Fabricator block, considering the association between the Website, Page, and Property models?
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
-
Hi there, First, thanks for this awesome plugin.
I have a question regarding the usage of Filament Fabricator in conjunction with my Website and Page models.
In my Laravel project, I have a Website model that has a one-to-many relationship with the Page model. The Website belongs to a Real Estate Property. Here's a snippet of the relevant code:
Now, within my Page Resource, I've integrated Filament Fabricator with blocks like PropertyMap, PropertyDetailsTable, etc.
My challenge is populating these blocks with information from the associated Property Model.
I've attempted to achieve this in the Block's mutateData function. However, I'm unsure about the best approach to access the Property Model based on the Website to which the page belongs. The Website model has a property_id
Could you please provide guidance or advice on the most effective way to access the Property Model within the Filament Fabricator block, considering the association between the Website, Page, and Property models?
Thank you in advance for your assistance.
Beta Was this translation helpful? Give feedback.
All reactions