// Suppose tha my model is Tool; Tool::all()->filter( // Here you can filter the Tool model fn (Tool $tool) => in_array($tag, $tool->getAttribute("tags")) );