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.

Create custom, distributable web components with VueJS

Link –

Marcel Pociot, author of the excellent BotMan package, published a post on how he used Custom Elements for VueJS to power a widget that users can embed on their sites.

I am currently in the middle of working on a new BotMan feature - a frontend widget that you can embed into your website to make it easier to connect your website visitors with your own self-hosted chatbot solution. The backend / PHP side is already working and leverages the BotMan web driver, which is basically just an API that you can use to interact with your chatbot.

http://marcelpociot.de/blog/2017-12-08-using-custom-vuejs-elements

Read more

24 Days in December: thoughts of the PHPamily

Link –

24 days in december is a site where every day, from start of December until Christmas, a new post by someone in the wide PHP community is published. The blog authors are hand picked by Andreas Heigl who runs the site. Here's an excerpt of the post by Kalle Sommer Nielsen that was published to today.

PHP has a tremendous community behind it, that community consists of you and me, and millions of others that help promote PHP by continuing to develop awesome applications that power some of the biggest websites in the world, but within this community exists a relatively small community that actively develops PHP, such as making it run on your favorite platform or making your favorite extensions compile and work or even keeps the documentation up-to-date. Today I want to dwell into that community, and perhaps giving you flavor enough to contribute back to PHP with code

https://24daysindecember.net/2017/12/11/giving-back-to-php/

Be sure to check out the posts by Morten Bergset, James Titcumb, Juliette Reinders Folmer and all others too.

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.

Organizing code into domain modules

Link –

In a new post to his site Mathieu Napoli makes the case for organising your code based on it's function rather than it's type.

We recently discussed 2 topics seemingly unrelated with my colleagues at Wizaplace: how to organize code? How to organize teams? ... Organizing code into domain modules is not a silver bullet but it forces to better understand the problem we are solving and better structure our code.

http://mnapoli.fr/organizing-code-into-domain-modules/

Read more

Atomic commits: telling stories with Git

Link –

Frederick Vanbrabant published another delirious rant on his blog. This time it's about atomic commits.

Atomic commits, sometimes also called micro commits, is the practice of explaining your thought process in the form of commit messages and code. It comes down to documenting the way to the solution.

https://frederickvanbrabant.com/2017/12/07/atomic-commits.html

Read more

Symfony 4: New Hope

Link –

In an article on his Medium blog, Jerzy Zawadzki wrote about the most important changes made in Symfony 4.

Internally, Symfony 4.0 is “just” Symfony 3.4 with removed depracations. But from outside there is a big leap forward. Most changes (from the installation process, directory structe through using bundles, to coding itself) were made to improve Developer Experience with the framework. Such system like Symfony, which can be used to create web apps as easily as to build other frameworks on top of it, must be complicated. But, as Symfony proves in new version, this complexity may be ‘hidden’ from the developer eyes.

https://medium.com/@zawadzki.jerzy/symfony-4-new-hope-dbf99dde91d8

Read more

Symfony now has an improved dump function

Original – by Freek Van der Herten – 2 minute read

Let's talk a little bit about Symfony's dump function. It's part of their VarDumper component. The function can dump a variable to the screen or browser in a nicer format than PHP's native var_dump. In the recently released Symfony 3.4 and Symfony 4 the function got a nice little improvement that…

Read more

A package to use optimised UUIDs in Laravel

Link –

Using regular UUIDs stored as a text-based primary key is very slow. Our newly released package spatie/laravel-binary-uuid aims to solve that by binary storing a slightly tweaked version of the UUID. My colleague Brent wrote a blogpost describing how it works behind the scenes. He also included some interesting benchmarks.

The binary encoding of UUIDs solved most of the issue. There's one extra step to take though, which allows MySQL to even better index this field. By switching some of the bits in the UUID, more specifically time related data, we're able to save them in a more ordered way. And it seems that MySQL is especially fond of ordered data when creating indices.

https://www.stitcher.io/blog/optimised-uuids-in-mysql

Read more

murze.be turns three

Original – by Freek Van der Herten – 2 minute read

Three years ago I started this blog to share my bookmarks and interesting links with fellow developers. Like on the previous anniversaries I'd like to share some cool statistics from the past 12 months. For the period spanning from end november 2016 until end november 2017 my little blog served 591…

Read more

Native HTML5 form validation in 6 lines of code

Link –

Dave Rupert, lead developer at Paravel, shows how you can leverage native form validation and still style your errors using only a couple of lines of JavaScript.

If you’ve ever experimented with HTML5 Form Validation, you’ve probably been disappointed. The out-of-box experience isn’t quite what you want. Adding the required attribute to inputs works wonderfully. However the styling portion with input:invalid sorta sucks because empty inputs are trigger the :invalid state, even before the user has interacted with the page. I finally sat down and spent a couple days trying to make HTML5 Form Validation work the way I want it.

https://daverupert.com/2017/11/happier-html5-forms/

Read more

An approach to testing middleware

Link –

Laravel rockstar TJ Miller posted a short and sweet post how how he tested a middleware that forces requests to respond with JSON.

So what I’ve done here is define custom testing routes and applied the middleware as I would use it in the application routes, in this case global middleware and as middleware for the api group. This allows me to assert that the middleware is configured and functioning correctly.

https://medium.com/@sixlive/an-approach-to-testing-middleware-c547fc942848

Read more

How to Read Big Files with PHP (Without Killing Your Server)

Link –

In a new blogpost published at Sitepoint, Christopher Pitt explores the various ways you can handle reading big files in PHP.

Though this isn’t a problem we frequently suffer from, it’s easy to mess up when working with large files. In asynchronous applications, it’s just as easy to bring the whole server down when we’re not careful about memory usage.

This tutorial has hopefully introduced you to a few new ideas (or refreshed your memory about them), so that you can think more about how to read and write large files efficiently. When we start to become familiar with streams and generators, and stop using functions like file_get_contents: an entire category of errors disappear from our applications. That seems like a good thing to aim for!

https://www.sitepoint.com/performant-reading-big-files-php/

Read more

Anatomy of a PHP Hack

Link –

Aaron Saray recently found some rogue code on a hacked website and investigated what it actually does.

It’s hard to come up with a title for this - but - basically I found some rogue code the other day that I thought was pretty interesting. I was fixing a “hacked” website when I came across the source of the symptoms of the hack.

This obfuscated code is doing something bad, but we don’t know what at first glance. Obviously, the solution is to remove it - but - aren’t you a little curious what it was doing? Let’s take a look.

https://aaronsaray.com/2017/anatomy-of-a-php-hack.html

Read more

The Cost Of JavaScript

Link –

Probably you know that that keeping the disk & transfer size of a JavaScript file low is pretty important. But have you considered the time needed to parse and compile the code? In this great post on Medium Addy Osmani, an engineer at Google, explains the complete cost of having JavaScript on your page.

As we build sites more heavily reliant on JavaScript, we sometimes pay for what we send down in ways that we can’t always easily see. In this post, I’ll cover why a little discipline can help if you’d like your site to load & be interactive quickly on mobile devices. tl;dr: less code = less parse/compile + less transfer + less to decompress

https://medium.com/dev-channel/the-cost-of-javascript-84009f51e99e

Read more

Reducing the size of a css file

Original – by Freek Van der Herten – 2 minute read

PurgeCSS is a tool that can reduce the filesize of a CSS file. It does this by removing any css classes that are not used. It can detect which CSS classes are used by scanning the source files of your application. In this tweet Jonathan Reinink shared how it can be configured in Laravel Mix: ???? I…

Read more

On migrating my blog from WordPress to a Laravel application

Original – by Freek Van der Herten – 12 minute read

Regular visitors will have noticed that last week this blog got a new coat of paint. This new layout isn't just a new WordPress theme. Things have changed on the backend as well. Previously my blog was powered by WordPress. I've migrated it to a custom built Laravel app. That app is open sourced.…

Read more