Ollie Read

Results 61 comments of Ollie Read

> If this is opt-in on a per-model basis but also support an as-needed opt-out like `Model::findFresh($id);` then that'd resolve my concern. It's entirely opt-in with `identifiable`, and when you...

> In a package context I'd have to call `refreshIdentityMap()` at the start of most of my functions cos I can't guarantee that bad calling code hasn't modified a model...

I think I'm doing a bad job of explaining this right now, and I don't want to fill this PR with a lengthy conversation about the identity map architectural pattern...

> Re: Octane, wouldn't clearing the identity map cache before serving any request do the trick? Actually, the identity map would be amazing with octane. It would need some sort...

> I'm so glad to see there is an appetite for this because I've wanted this for sooo long in Laravel. It would reduce number of queries and memory requirements,...

> This is a form of caching and caching is very hard to get right It's only "technically" caching because it stores objects that it uses later on. The use...

> Big change with small benefit Also, since it's opt-in, it's literally no change.

Sorry @driesvints, I need to write the tests for this, I was super busy sorting some stuff for the last few weeks but will look at it asap.

It is also unaware of `Attribute::$flags` https://psalm.dev/r/8f628693b7, which I believe is controlled by `stubs/Php80.phpstub`

> > I'm more than happy to create a PR > > Go for it! Just be sure to use the correct `Phpxx.phpstub` for things that don't exist in all...