this should work if your relationships are setup correctly
$note = Note::findOrFail(intval($id));
foreach ($note->labels as $noteLabel)
{
$noteLabels[] = $noteLabel->id; // Label
}
$labels = Label::whereNotIn('id', $noteLabels)->orderBy('name', 'asc')->get();
Oh my God. I'm too tired or just stupid. Maybe both, I absolutely forgot about this. Thank you :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community