Open anzalpa opened 2 years ago
Which model do you want in the search results? Participant, Project, or do you want the ParticipantProject pivot as result?
@pascalbaljet I want to search the first_name and last_name on the pivot table(participant_project)
@anzalpa did u mange to resolve this ?
@pascalbaljet Is it possible to search on pivot table?
I have the following models (participant belongsToMany project),
Getting
Column not found: 1054 Unknown column 'project_participant.id' in 'field list'
error when I try this; as I don't have an id column in the pivot table.Also, I tried using
join
, but not working as expected->add(\App\Participant::join('project_participant', fn($join) => $join->on('participants.id', '=', 'project_participant.participant_id')->where('project_participant.project_id', 8)), ['project_participant.first_name', 'project_participant.last_name'])
Is there any way to achieve this?