On laravel I have 2 requests :
$interviewers = Interviewer::get()->pluck('name', 'id');
$defaultInterviewers = UserMeetingInterviewer::getUserMeetingId($this->record->id)->get()->pluck('id');
How to leave in $interviewers only values which exists in $defaultInterviewers ?
Sure I know how use foreach with new var, I mean methods from https://laravel.com/docs/10.x/helpers...
I did not find…
"laravel/framework": "^10.35.0"
Thanks in advance!
2
Answers
Move the $interviewers one step down. As you are not using anywhere in the $defaultInterviewers.
intersect method should work
but you have to put
$interviewers
after$defaultInterviewers