F
Filament4mo ago
Daniel

Call to undefined method App\Models\User::buildings()

I have this method in my relationManager of buildings with users
->headerActions([
Tables\Actions\AttachAction::make()

])
->headerActions([
Tables\Actions\AttachAction::make()

])
However, in my User model the method is called workingBuildings :
public function workingBuildings():BelongsToMany{
return $this->belongsToMany(Building::class);
}
public function workingBuildings():BelongsToMany{
return $this->belongsToMany(Building::class);
}
How can I customize the name of the relationship? ->relationship does not exist for this action.
1 Reply
nanopanda
nanopanda4mo ago
@Daniel (from Brazil) check out these statics on your RelationManager class:
protected static ?string $relationship
protected static ?string $inverseRelationship
protected static ?string $relationship
protected static ?string $inverseRelationship
Want results from more Discord servers?
Add your server