Oh Dear is the all-in-one monitoring tool for your entire website. We monitor uptime, SSL certificates, broken links, scheduled tasks and more. You'll get a notifications for us when something's wrong. All that paired with a developer friendly API and kick-ass documentation. O, and you'll also be able to create a public status page under a minute. Start monitoring using our free trial now.

Loading Eloquent relationship counts

Link – timacdonald.me

There are three ways of loading relationships in Laravel. Tim MacDonald, a freelance dev based in Sydney, explains them all.

It is often useful to show the number of related models a given instance has, but not actually need any specific information about the related models, just how many exist. In this scenario you do not want to load all of the related models into memory to count them, we want our database to do the heavy lifting for us. Laravel offers a number of ways to retrieve relationship counts.

Read more [timacdonald.me]

Calling an invokable in an instance variable

Original – by Freek Van der Herten – 2 minute read

Invokables in PHP are classes that you can use as a function. They have been around since PHP 5.3 and have many interesting use cases. Here's a quick example. class Invokable { public function __invoke() { echo 'I have been invoked'; } } You can use it like this: // outputs 'I have been…

Read more

Stay up to date with all things Laravel, PHP, and JavaScript.

You can follow me on these platforms:

On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.

Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

Using v-model on Nested Vue Components

Link – zaengle.com

Woodworker/developer Jesse Schutt clearly explains how to use v-model properly on nested components.

Building a custom component that operates on chunks of data is easier than you may think. It involves understanding how Vue handles the input/update cycle and making a few changes to your component. Let’s start by taking a look at one approach for turning a standard component into a “controlled” component and then figure out how to nest them.

Read more [zaengle.com]

Are you sure you need entrust or laravel-permission to implement your authorization?

Link – adelf.pro

Some solid advice from Adel Faiz: do not use a package for authorization unless you really need its functionalities. Laravel's default authorization capabilities are good enough for most use cases.

I don't want to say these packages are useless. They can be useful for projects which needs complicated authorization system, which should be customizable by customer later. Also some projects need dynamic permissions. For all other projects it's too heavy solution. Better to use simple code-based authorization.

Read more [adelf.pro]

Other people's setup

Link –

A couple of week ago I wrote a blogpost that contains all the software, hardware and settings I use. I've seen a couple of devs writing the same kind of post. Here are some of them:

Did you write down your setup as well? Post a link in the comments below! ?

Read more

Fixing Imagick's “not authorized” exception

Link – alexvanderbist.com

The last couple of weeks soem strange Imagick errors popped up across all our servers. In a new blogpost my colleague Alex explains the cause and the fix.

Over the last few days we've had a couple of issues with Imagick and processing PDFs on our servers. As it turns out, these issues are caused by automatic security updates. Let's look into the issue and its solution.

Read more [alexvanderbist.com]

Automatic monitoring of Laravel Forge managed sites

Link – ohdear.app

Oh Dear!, the monitoring service that my buddy Mattias and I run, now has the ability to auto import sites from Forge.

Forge recently introduced a feature called tags, whichs allows you to add custom tags to any server or site in Forge. We use those tags to determine which sites we should automatically add to your Oh Dear! Account. Every site or server tagged with oh-dear will be added. This allows you to still pick which sites should - or should not - get monitored.

Read more [ohdear.app]

ngrok, lvh.me and nip.io: A Trilogy for Local Development and Testing

Link – nickjanetakis.com

Nick Janetakis shares three tools that come in handy when developing locally.

When developing real world applications you tend to run into certain road blocks such as:

  • How do I test webhooks locally?
  • How can I show a demo of my site to a client?
  • How can I develop a web app that uses subdomains on localhost?
  • How can I test Let’s Encrypt without a domain name? In this article, we’re going to cover all 4 use cases using 3 free tools and services.

Read more [nickjanetakis.com]

Why geeks should speak

Link – justinjackson.ca

Justin Jackson wrote a cool post on the benefits of public speaking.

As a geek, there's one skill that's helped me level-up professionally more than anything else: public speaking. Whether it's doing product demos, presenting an idea to my team, or being on a podcast, it's a skill I benefit from every day. But the biggest opportunities have come from giving talks.

Read more [justinjackson.ca]

Making Nova fields translatable

Original – by Freek Van der Herten – 5 minute read

Laravel Nova is cool package to quickly create admin interfaces in a Laravel app. Unfortunately there's no support for multiple locales out of the box. A while ago we published a package called nova-translatable that makes any of the built in field types translatable. Using the package In order to…

Read more

Laravel Telescope: Data too long for column ‘content’

Link – ma.ttias.be

Mattias explains a problem we recently encountered at Oh Dear with Telescope.

For Oh Dear!, we're using Laravel Telescope as a convenient way of tracking/displaying exceptions, runs, ... It stores its exceptions in the database, so you can easily view them again. It stores those in a TEXT field in MySQL, which is limited to 2^16 bytes, or 65536 bytes. Some of our exceptions tend to be pretty long, and they were hitting this limit.

Read more [ma.ttias.be]

How to size & scale your Laravel Queues

Link – ohdear.app

My buddy Mattias and I run a monitoring service called Oh Dear! We plan on regularly writing cool stuff on the technical and commericial challenges we face. Here's the first post on how we scale our queues.

Laravel offers a convenient way to create asynchronous background tasks using its queues. We utilize those heavily at Oh Dear! for all our monitoring jobs and in this post we'll share some of our lessons learned and what we consider to be best practices.

Read more [ohdear.app]

Unslacking Tideways Company

Link – beberlei.de

Benjamin Eberlei wrote a post on why and how he got rid of Slack in his company.

We have moved away from Slack at Tideways over the last three months, because I found Slack is already annoying, even with just a four person team (plus the occasional freelancer). For me, it disrupts deep work phases and knowledge lost in the depth of chat history.

Read more [beberlei.de]

Major performance problems when running PhpStorm on a scaled resolution

Link – stitcher.io

It's very frustrating I can't use a scaled resolution on my Mac because of PhpStorm.

PhpStorm has had performance issues on OSX for a very long time now, sometimes to the point of being unusable. I've written about these issues before, but it's good to keep a regularly updated list of what's going on. So without further ado: if you're on OSX (Sierra, High Sierra or Mojave); if you're experiencing PhpStorm performance issues, this post might help you.

Read more [stitcher.io]

Our packages have been downloaded 20 million times

Original – by Freek Van der Herten – 3 minute read

At Spatie we do a lot of open source work. You can find a list of our packages on the open source section of our website. I'm proud to share that, according to Packagist, the Spatie packages have now been downloaded over 20 million times. The rate at which they are being downloaded is growing too.…

Read more

Replacing a built-in PHP function

Link – akrabat.com

Rob Allen performs a cool test.

Recently I needed to test part of Slim that uses the built-in PHP functions header() and headers_sent(). To do this, I took advantage of PHP’s namespace resolution rules where it will find a function within the same namespace first before finding one with the same name in the global namespace.

Read more [akrabat.com]

Building something new

Link – assertchris.io

Christopher Pitt has built his own new blog. Of course he uses lots of preprocessing goodness.

In fact, this whole blog is built on preprocessed code. Why? Because I want to see what I can build, using a technology that 99% of vocal PHP developers (read: people on Reddit and Twitter) scoff at. I want to show that preprocessing works well and is popular in other languages.

Read more [assertchris.io]