Laravel – Forget cache on save
As highlighted by Povilas Korop (@PovilasKorop) on Twitter: in Laravel, you can call a static "saved" function on your model to forget the cached values with a specific key. Let's…
As highlighted by Povilas Korop (@PovilasKorop) on Twitter: in Laravel, you can call a static "saved" function on your model to forget the cached values with a specific key. Let's…
In a tweet by Tom Herrmann (@devgummibeer) (https://gummibeer.dev/), he discussed how using syncWithoutDetaching() call can kill a database. Basically, instead of doing: $user->identifiers()->syncWithoutDetaching($identifiers); Do this: DB::table('identifier_user')->having()->insertOrIgnore( $identifiers->map(fn (Identifier $identifier) =>…