Lazy Loading a Laravel Model relationship through a repository

If your Laravel Model needs access to repository for pulling relationship data, think again.

It’s the wrong way round, don’t do it. Your models need access to data without any N+1 issues from using Lazy load. So if you need to merge some data streams and return a collection, rather than use a repo call to access each stream object; Create a view table which `Union ALL`’s the data various models. Then the model can have lazy load access to all the things you need, and the laravel commands, `->with()` or `->load()` can work without slowing it all down

Paying the Mac “Tax”

Paying the Mac Tax, or “should I buy our developers Macs or cheaper PCs?”.

Often the idea of buying staff an Apple Mac’s for work seems like a poor business decision. It’s expensive and surely nothing more than “pretty thing”. Doesn’t everything work on Windows anyway right? You can hear it in your mind saying, “how much! Just use a PC, all you want to do is look fancy for an extra £grand”

And that’s fair enough because on the surface the “Mac tax” doesn’t seem worth it for a shiny computer that no one really knows how to use right?


However twist your mind round to this for a second, for your accountants, they work best in a full Microsoft Office Excel package or Sage Accounting right? When they joined you gave them a spreadsheet you once made four years ago, a keyboard with Arabic numbers in a different order and an abacus on the side, would you expect them to work at their full capacity? Would you expect quality output? Would you expect them to enjoy their work? Nope. Nope, you wouldn’t, and it doesn’t make business sense.

..put them on a Windows PC you’re already giving them compatibility issues (and devs have enough trouble with that already :P)

I’m afraid, this situation is the same as not buying a Mac for your staff. A lot of the work they’re probably going to be doing for LAMP stack will be Linux based, but to put them on a Windows PC you’re already giving them compatibility issues. But if you put them in the same operating system ecosphere you start to reap actual benefits of coding in the same environment. Mac apps have access to a multitude of our “menu reduced” development solutions. A lot of the apps are exceptionally cheap (like iOS App Store prices), a lot of the apps are more often than not, free to use and open source… built on Linux (not Windows).

Also, be honest with yourself, how often do to start restart your Windows device? Honestly your Mac doesn’t need that, once a month if that.

You are effectively paying to slow your staff down #falseEconomy

I know you may feel more comfortable and productive with Windows, but be brave. You wouldn’t give your new accountant an abacus, don’t give your developers a Windows PC.

It’s slightly ironic, because Apple are massive Tax Dodgers. But this is more to do with should we get our dev a Mac or Windows?

First thoughts on Amy (x dot aiiiii)

Last week I was part of the lucky few to get onto Amy’s good list. I made it to the automated personal assistant free account and she happily just set about handling her first meeting.

So how’d it go? Over-all it was great, and sooooo close…… The on-boarding was real easy. The instructions are REALLY clear and the start of the process was easy. Also, the real test, both participants made it to the meeting.

But right near the event, here’s where it went slightly off the rails. My colleague. helpfully emailed over his phone number, just in-case I got lost or needed a hand. Amy however, she auto-resent out a new invite to everyone updating the meeting from a “Meet in person” to a “Call” eeek.


Because I’m not a total truster of new tech I only let Amy book up a simple meeting with one person who I know, however if this was for a few people and in the last minute it tried to re-arrange something that could have been a problem.

I wonder if Amy could have a “1 hour to meeting *lock*”, where the ususal flurry of emails from anyone but the organiser will ask permission to change the details rather than straight away sending out 10 new invites and changing the scope of the meet. That or improved understanding of people sending their phone number just to be helper.

Now I know it’s naughty only posting stuff when it doesn’t work, but I hope you’ll see from this that I really like so far, and a tweak would make it less panicy.

gitlab CI fail 128 and how to solve it

If you are seeing this, then it means an earlier test has spannered out so bad that it’s now preventing other tests from working.

This quickest way to un-block it is… ssh into the runner and delete the .git/index.lock! Then re-run and it should all clear out.


fatal: Unable to create '/home/admin/tmp/builds/runner-XXX/.git/index.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

Build failed with exit status 128]

2 new Laravel things I’m using

Just wanted to share these two simple things I’ve recently found for Laravel 5.3

1. Repository Generator

This packages just removed about half a day of setting up the backend CRUD per. Model / Entity. A few commands, follow the instructions and then boom, you’ve got a fully functional repository class.

Sure, I’d need to write my on Tests around it performing as “expected”, however, I now have a basic Interface and Abstract which I can use across different Models.

2. Laravel Collective “Custom Components”

Laravel Collective packages have been staple Laravel components for a while now, however I’ve never quite got to down all the docs (just whizzed on with the bits I need).

I’ve found the Custom Components part method. Before I’ve been creating a new “HTML Components” service class and linking up blade template files with that, however, now I can just keep it within the HTML Facade without any trouble. Much cleaner!

Strengths Finder 2.0 – Gallup

Strengths Finder 2.0 – Gallup

My Personal Strengths @dancourse

> 1 Strategic
> 2 Ideation
> 3 Relator
> 4 Includer
> 5 Significance

The book, Strengths Finder 2.0

We all like a good personality quiz, c’mon you’ve been tempted by a few Quizzes on your Facebook profile and Buzzfeed right? You hope they may reveal some insight and reflect some personal characteristics back at you whilst making you accept you may be more Hufflepuff than Gryffindor.

Well the Strengths Finder 2.0 by Gallup is a professional version of horoscopes / Buzzfeed questionaries for your working life. It offers you insight into your strengths, personality traits and supplies action plans.

The main drive for this “Strengths only approach” is the theory that your Effort multiplied by your Strengths will give you bigger gains than working tirelessly on your weaknesses for minimal gain.

Strengths X Effort = Maximum results

So ignore the weaknesses, multiply your talent and boss it.

I’ve done DISC profiles before with Inge, and I’ve had nearly a similar benefit from this. You get reaffirmation of your values back to you, but with this, it comes with dropping the baggage of your weaknesses and only aiming to take action on your Strengths.

The book, Strengths Finder 2.0

The Lean Startup – joining up the pieces

What a relief to find this book. It’s already beginning to tie up a few concepts I’ve heard over the years and make them form a better picture of what’s been going on in the Tech / Startup industry.

The Lean Startup

It was Jamie King who mentioned it at Games for Health Conference UK 2016 in Coventry, and since purchasing it, the book has been a welcome companion on my daily travels.

It talks of reducing waste and validating assumptions. It talks of validated learning and not just saying, “we’ve all learnt a lesson” and moving on to make the same mistakes again. It talks about making experiments part of the fabric of your work and making things which fail but validate assumptions on your vision and helps you move along.

By doing experiments, like split tests on your site or bootstrapping business ideas, you learn about your visions cheaply, and reduce waste.

It’s so like Agile development, but for your business ideas.