Looping names of members in a table.
in given image there is the users names are looping because of the relation but i want to do not loop it i want to put this one by one names how can we overide the relations looping functionallity. here is the codes
this is the table code from where i am getting the data like given in image.
ProjectMemberResource column data
ImageColumn::make('project.members.user.profile_photo_path') ->circular() ->grow(false) ->label(''), TextColumn::make('project.members.user.name') ->weight(FontWeight::Bold) ->searchable() ->label('User')->url(static fn (Model $record): string => FreelancerResource::getUrl('edit', ['record' => $record->freelancer_id])),and here is the relation of projectMember model
class ProjectMember extends Model
{
use HasFactory;
protected $guarded = ['id'];
protected $touches = ['project'];
public $timestamps = false;
public function project(): BelongsTo
{
return $this->belongsTo(Project::class);
}
}
and here is the Project model where i have a relation members
public function members(): BelongsToMany { return $this->belongsToMany(Freelancer::class, 'project_members'); }because of that above relation it is looping how can i solve by using filamentphp. thank you in π
0 Replies