You could make it an attribute. It seems that objects are cached by default.
This is possible because Eloquent retains instances returned by accessors so it can return the same instance each time the accessor is invoked
I believe the following should work:
use Illuminate\Database\Eloquent\Casts\Attribute;
protected function unknownItems(): Attribute
{
return Attribute::make(
get: fn () => Item::where('source_id', $this->id)
->whereNotNull('dependency_filename')
->doesntHave('models')
->doesntHave('items')
->distinct('dependency_filename')
->orderBy('dependency_filename')
->get()
);
}