The router docs are a little bit muddy with redirects. Push the new route onto the stack to redirect. Replace the route on the stack to replace in the browser. Extra: Updating querystring Changes the querystring in the URL bar to match the filters parameter. Uses ‘replace’ to save polluting the back history (I hate […]
Monthly Archives: March 2020
Laravel – re-assign relationships in updates
Alternate title: Stop stuffing around with entity_id. Working on a project with a representative – a user who looks after the company. When changing the representative, I want to supply the whole representative to the update method – e.g. $customer->representative is an object with an id, name, etc. It’s just a pointer, but it means […]
Vue.js – mapGetters with Params
Using mapGetters with parameters isn’t well defined in the docs, and is a pattern I go to use pretty regularly. I never find a good search result, so here goes: 1.Define the getter in the store. Take note that the naming convention will be [store namespace]/[getter name] later. Since this is in my users store, […]
VueX Patterns: Updating in Array
When working on a type of entity, it’s common to post the new or updated entity to the server and then need to update it in the local vuex data store. This is a simple pattern that propagates the changes to the UI displaying the list of entities. 1. Save the entity, from the UI. […]
Solar in Bargo – numbers
We installed solar at our house in Bargo 2574 (a town in Wollondilly, NSW) in March 2020. It cost approximately $5k for a 6.5kW system (feeding into a 5kW inverter). Half the panels face west, and half face north. I’ve always been concerned that people who install solar need to convince the world that it […]