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
@pascalbaljet Is it possible to search on pivot table?
I have the following models (participant belongsToMany project),
participants
id
participant_project
participant_id
project_id
first_name
last_name
projects
id
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?
The text was updated successfully, but these errors were encountered:
@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?
The text was updated successfully, but these errors were encountered: