'array', ]; public function ingredients() { return Ingredient::whereIn('id', collect($this->products ?? []) ->pluck('ingredients') ->flatten() ->unique() ->toArray() ); } }