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.

Value objects like a pro

Link –

On the Hackernoon site Nicolò Pignatelli wrote a good guide on how to write Value objects in a good way.

This is the list you must always check it against:

  • it is immutable and no setters defined;
  • it reflects the semantics of the domain;
  • it shows how information flows and is transformed during runtime;
  • it hasn’t default or useless getter methods;
  • it can be compared to other Value Objects of the - - same class by reading private properties directly

https://hackernoon.com/value-objects-like-a-pro-f1bfc1548c72

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.

Enabling PHP method chaining with a makeshift pipe operator

Link –

Sebastiaan Luca, a freelance Laravel developer from Antwerp, coded up a couple of functions that mimic a pipe operator.

An interesting RFC proposal by Sara Golemon submitted in April 2016 suggested the use of a pipe operator to enable method chaining for any value and method. Yet as of today, it's still being discussed and there's no saying if it will ever make its way into PHP. So in the meantime, here's a solution!

https://blog.sebastiaanluca.com/enabling-php-method-chaining-with-a-makeshift-pipe-operator

Let's hope a real pipe operator will land someday in PHP.

Read more

A pair of helping hands when naming things

Link –

In a new post on his blog Sebastian De Deyne shares a few services and tools he uses to help him with naming things.

One of the hardest (and sometimes frustrating) tasks in a programmer's day-to-day workload is naming things. When I have a hard time finding that perfect word, I generally wind up in one of two situations:

  • I have a plausible name in mind, but I'm not entirely satisfied with it
  • I have no idea what I could possibly name it

Luckily, there are tools out there that can be of help.

https://sebastiandedeyne.com/posts/2018/a-pair-of-helping-hands-when-naming-things

Read more

Using Content Security Policy headers in a Laravel app

Original – by Freek Van der Herten – 5 minute read

By default all scripts on a webpage are allowed to send and fetch data from and to any site they want. If you think about it, that's kinda scary. Imagine that one of your JavaScript dependencies would send all keystrokes, including passwords, to a third party website. That would be pretty bad. In…

Read more

A new security header: Referrer Policy

Link –

Almost a year ago, Scott Helme, creator of securityheaders.io and report-uri.com, wrote a blogpost on a not well known http header: Referrer-Policy.

Regular readers will know how fond I am of the existing security headers so it's great to hear that we're getting another! Referrer Policy will allow a site to control the value of the referer header in links away from their pages.

https://scotthelme.co.uk/a-new-security-header-referrer-policy/

Read more

Regaining trust in your test suite with Docker

Link –

Frank de Jonge, creator and maintainer of Flysystem, recently started using Docker to test the FTP driver. On his blog he explains the why and how.

For Flysystem, an open source PHP package to deal with filesystems, I needed a way to test FTP (barf) interactions. FTP servers are notoriously bad at abiding by the spec. ... For Flysystem's FTP(d) adapter an integration test, using an actual FTP server, brought back the level of confidence it needed.

https://blog.frankdejonge.nl/regaining-trust-in-your-tests-with-docker/

Read more

Extended validation is broken

Link –

In a new article on his blog Ian Carroll shows that it's quite easy to trick users into thinking that they're connected to the right site.

Extended validation ("EV") certificates are a unique type of certificate issued by certificate authorities after more extensive validation of the entity requesting the certificate. In exchange for this more rigorous vetting, browsers show a special indicator like a green bar containing the company name, or in the case of Safari completely replace the URL with the company name. ... Today, I will demonstrate another issue with EV certificates: colliding entity names. Specifically, this site uses an EV certificate for "Stripe, Inc", that was legitimately issued by Comodo.

https://stripe.ian.sh/

Read more

Setting up Laravel Horizon with Forge and Envoyer

Link –

Dries Vints, maintainer of Laravel.io, posted a step-by-step guide on how to get started with Laravel Horizon on a Forge provisioned server.

I recently installed Horizon for Laravel.io and while it wasn’t that hard to install, I still had to figure some things out. Since this was the first time setting everything up I thought I’d write up the steps to take to get started with Horizon and set everything up with Forge and Envoyer.

https://medium.com/@driesvints/laravel-horizon-with-forge-and-envoyer-82a7e819d69f

Read more

A package to assign statuses to Eloquent models

Original – by Freek Van der Herten – 2 minute read

Imagine you want to have an Eloquent model hold a status. It's easily solved by just adding a status field to that model and be done with it. But in case you need a history of status changes or need to store some extra info on why a status changed, only adding a single field won't cut it. To handle…

Read more

Optimize programming by optimizing for scannability

Link –

Michael D. Hill posted a great new video on his blog where he makes the case for optimizing for scannability.

As programmers trying to ship more value faster, we want to optimize first around the part of the work that we spend the most time on, and that is scanning code– formulating little, tiny questions and flipping through the code looking for the answers. We optimize for scanning by focusing our attention on sizing, grouping, and, above all else, naming.

http://geepawhill.org/optimizing-a-program-and-programming/

Read more

Blade component aliases in Laravel 5.6

Link –

Laravel 5.6 will probably ship this wednesday. One of the cool new features is the ability to register Blade component aliases, which was PRed by my colleague Seb. On his blog Seb guides you through the new functionality.

Laravel 5.6 adds the ability to register alias directives for Blade components. Let's review some background information and examples.

https://sebastiandedeyne.com/posts/2018/blade-component-aliases-in-laravel-56

Read more

Customizing the Spatie dashboard

Link –

At Spatie, we have created a dashboard powered by Laravel, Pusher and Vue that displays a lot of information useful for our company. We opensourced the dashboard a while ago.

In a new post on his company blog Chris Sherry explains how they customized our dashboard.

We use Laravel because its a well-known framework among backend developers, meaning there’s a bigger community (including lots of open source libraries), great documentation and a tonne of experience of using the framework.

Vue.js is our first choice because it lets our frontend developers build components for a project without being to be locked into building the whole project on the framework, meaning we can use the right tools for the right job.

The fact that the Spatie dashboard used these meant that all the developers at CUBE would be able to build their own components for it, which was one of my key objectives.

https://3sidedcube.com/blog/2018/02/building-dashboard-laravel-vuejs/

It's really great to see that people customize and use our stuff!

Read more

Automatic visual diffing with Puppeteer

Link –

Monica Dinculescu, an engineer at Google, shares on her blog how you can use Puppeteer, Mocha and Pixelmatch to create automated visual tests of a webpage.

I did a little song-and-dance that sets up Puppeteer* , takes screenshots of your app (like, all the routes you care about), and then compares them to the “golden” ones. If they match, your test passes! Yes, it only works on Chrome. No, it’s not actually unit testing. Yes, it’s literally just counting pixels but you know what? It counts them in both a wide and a narrow viewport size and any testing is better than no testing at all; fight me.

https://meowni.ca/posts/2017-puppeteer-tests/

Read more