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.

Benchmarks on sorting and serializing associative arrays vs classes in PHP

Link – steemit.com

Larry Garfield, director of developer experience at Platform.sh, published some interesting numbers on arrays vs classes.

The first thing we can conclude is that if the one and only thing you care about is serialization/deserialization performance, associative arrays still win. They're the most time efficient by more than 50%, and the most space efficient by up to 20%. The second thing we can conclude is that stdClass should be used basically never. It's slower and more memory intensive than arrays in every circumstance. Just don't go there.

Read more [steemit.com]

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 Laravel Mailables and Notifications as Event Listeners

Link – themsaid.com

In an older post on his blog Mohammed Said, Laravel Employee #1, shares a cool trick on how to avoid having to create an event listener.

Instead of having to create a class for the listener and another for the notification/mailable, wouldn't it be cool if we can register the Notification/Mailable as an event listener? ... While some may consider this an anti-SRP hack I think it's a pretty neat implementation that you can use in your application to prevent creating an extra listener class, your call :)

Read more [themsaid.com]

A modern text-based web browser in your terminal

Link –

Browsh is a small browser that you can run inside your terminal. If you don't want to install it locally, you can test is out by ssh'ing to it.

ssh brow.sh

Here's a screenshot of the https://www.brow.sh/ running in Browsh.

Browsh homepage

How cool is that! I don't see myself using this as my main browser soon, but it sure is a pretty cool project. It goes without saying that you should not type any sensitive data while using it via ssh.

Read more

A short introduction to laravel-event-projector

Original – by Freek Van der Herten – 1 minute read

The last few months I've been working on a package called laravel-event-projector. This package aims to be a simple and very pragmatic way to get started with event sourcing in Laravel. Ahead of it's release, which will happen in a few days, I've recorded a small video introduction. You can find the…

Read more

How to rid your database of PHP class names in Eloquent's Polymorphic tables

Link – josephsilber.com

Joseph Silber, a very active Laravel contributor, has written a new blogpost on morph maps, a feature to decouple your database from your model class names.

Polymorphic relations let you set up a relationship between many different model types, without the need for extra tables. This works by storing the "morphable type" (explained below) in the database, in addition to the morphable type's ID. By default, the morphable type stored in the database is the model's full class name. While this works, it tightly couples your database to your PHP application. Let's look at how we can instruct Eloquent to use more generic values for these morphable types.

Read more [josephsilber.com]

Using anonymous classes as private classes

Link – markbakeruk.net

Mark Baker, serial conference speaker and creator of the PhpSpreadsheet package shares some thoughts on how to create private classes using anonymous classes.

I’ve written before about the benefits of using PHP’s Anonymous Classes for test doubles; but Anonymous Classes also have potential usecases within production code as well. In this article I’m going to describe one such usecase that can be particularly useful within libraries, and that is replicating the access of Package Private (in Java), or Protected Internal Classes (as per C#).

Read more [markbakeruk.net]

How to build a cookieless Laravel app

Link – dieterstinglhamber.me

At Spatie We are currenlty building a new company website. One of the cool features is that it won't set a single cookie. In a new blogpost Dieter Stinglhamber explains how you can achieve this in Laravel.

Since May 25th you have been harassed by "We have updated our privacy policy" emails but also websites started to great you with "Please, let us and our 256 partners track you". In response to these abusive practices, some developers have decided to follow a better path, removing every cookie that is not needed.

Read more [dieterstinglhamber.me]

Lambda To The Rescue: Recursion

Link – engagor.github.io

Toon Daeleman, developer at Engagor, explains how functional languages use recursion instead of loops.

Most programming languages have language structures to loop through lists and do interesting stuff with those lists. When you're used to programming using one of those languages, it can be pretty terrifying to have your basics taken away from you when you jump into a functional programming language like Scheme or Haskell. Let's see what the problem is that functional languages have with loops and how they solved it.

Read more [engagor.github.io]

How to compile an unreleased PHP feature

Link – www.sammyk.me

Sammy Kaye Powers, the host of the PHP Roundtable podcast, wrote a blogpost on how to compile PHP from source including unreleased RFC's. After following this tutorial you'll be able to play with the [typed properties] that are currently under discussion.

We'll be discovering and testing a completely unreleased feature of php-src from an RFC that's still under discussion. If you've ever wanted to be ahead of the curve of PHP features or you've just wanted to contribute back to PHP internals, testing an unreleased feature from an RFC is a fun and educational way to do so.

Read more [www.sammyk.me]

Thoughts on PHP 8

Link – externals.io

On the PHP internals mailing list Zeev Suraski, a long time core contributor of PHP, started a discussion on what PHP 8 could look like.

As I mentioned a few days ago I intended to send it slightly later - but as Nikita brought up the topic of PHP 8, this is probably as good a time as any to start the discussion. Please note: The goal of this email isn't to discuss in detail each and every topic that's mentioned, but rather to establish whether we want to move to focus on PHP 8 as we go beyond PHP 7.3, based on some of the research projects and PoCs we've been working on.

Read more [externals.io]

Using EditorConfig

Link –

Frederick Vanbrabant recorded a new cool video, this time on EditorConfig.

EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems.

Read more