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.

Essential image optimization

Link –

Addy Osmani, a Google Chrome engineer, recently published a e-book on image optimization. You can read it in it's entirety here: https://images.guide/

Images take up massive amounts of internet bandwidth because they often have large file sizes. According to the HTTP Archive, 60% of the data transferred to fetch a web page is images composed of JPEGs, PNGs and GIFs. As of July 2017, images accounted for 1.7MB of the content loaded for the 3.0MB average site.

Per Tammy Everts, adding images to a page or making existing images larger have been proven to increase conversion rates. It's unlikely that images will go away and so investing in an efficient compression strategy to minimize bloat becomes important.

If you need to optimize images in your PHP application take a look at our image optimization package. If you're a Laravel user you'll be happy to know that there's also a Laravel version of the optimizer. Our Laravel Medialibrary also comes with built-in support for optimizing images.

Read more

Nordic.js 2017 videos have been released

Link –

Like the name implies Nordic.js is a conference that focuses on JavaScript. The organisers recently released all videos of the 2017 edition. Even if you're not into JavaScript I can recommend this watch this video of Harriet Lawrence on how you can use language to make your community more welcoming.

Here's a YouTube playlist with all videos of Nordic.js 2017.

My colleague Sebastian attended the conference, be sure to check out his recap.

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.

Handling Stripe payments in Laravel

Link –

Povilas Korop, creator of Laravel Daily and Quick Admin Panel, wrote an extensive guide on how to integrate Stripe into a Laravel application.

Stripe is one of the most popular payment merchants for web, but information about Laravel integration is pretty fragmented, so I decided to write a really long tutorial about this topic.

We will cover:

  • General logic how Stripe works
  • Simple one-time payment integration
  • Testing and production environment setup
  • Saving transaction data for future reference
  • Recurring payments with Laravel Cashier
  • Getting invoices data and PDF download

https://quickadminpanel.com/blog/stripe-payments-in-laravel-the-ultimate-guide/

Read more

Partitioning for concurrency in synchronous business processes

Link –

On his blog Frank De Jonge, member of the PHP League and creator of Flysystem, explains a cool pragmatic solution how to ensure queued processes for the same user complete in the right order.

The use of multiple workers allows for much higher throughput, but it also allows for race conditions during processing. When messages for the same user are sent to different workers, handling order can no longer be guaranteed. Therefore we have failed to fulfil our business rule.

If we were able to ensure every message from the same user were sent to the same worker, the worker could ensure those messages are handled in order while the system as a whole would still benefit from the degree of parallelism. But how do we make this happen?

https://blog.frankdejonge.nl/parallelise-synchronous-business-processes/

Read more

BetterReflection v2 has been released

Link –

The awesome Roave team has recently released v2 of their BetterReflection package. It can do anything PHP's native reflection API can, but without actually autoloading the code.

The operational concept is quite simple, really:
  1. We scan your codebase for files matching the one containing your class. This is fully configurable, but by default we use some ugly autoloader hacks to find the file without wasting disk I/O.
  2. We feed your PHP file to PHP-Parser
  3. We analyse the produced AST and wrap it in a matching Roave\BetterReflection\Reflection* class instance, ready for you to consume it.

Read all about it on Marco Pivetta's blog: https://ocramius.github.io/blog/roave-better-reflection-v2.0/

Read more

New features in our packages

Original – by Freek Van der Herten – 3 minute read

Every time our team releases a package I have the habit of writing an introductory blogpost. But after the initial release most pages gain more features through PRs by the community and ourselves. Mostly these new feature go unnoticed. That's why I plan on regularly writings posts on noteworthy…

Read more

Building an SMS admin powered by Laravel and Nexmo

Link –

JMac, the creator of Laravel Shift, shared how he can very easily spin up a new job on his service by sending a simple SMS message.

In the end, all I need is a quick way to run a Shift on the go. Looking back on almost two years of support, I often have the Shift number readily available. Creating the job and adding it to the queue is at most two lines of code. So the steps are not the pain point.

The pain point is connecting to the server. Unless I want to carry my laptop around, I can’t connect to the server to run the Shift. (I actually have taken my laptop with me during peak times.)

What do I carry around with me all the time? My phone. I’m already reviewing the support emails from my phone. Wouldn’t it be great when I need to run a Shift manually to just reply or send a text.

https://jason.pureconcepts.net/2017/09/nexmo-sms-admin-laravel/

Read more

Goodbye controllers, hello request handlers

Link –

Jens Segers, developer at Teamleader and author of the popular Optimus and laravel-mongodb packages, wrote about an alternative to controllers.

Let me introduce you to request handlers. The concept is very simple, yet very unknown to a lot of PHP developers. A request handler is basically a controller, but limited to one single action. This concept is very similar to the Action-Domain-Responder pattern which was proposed by Paul M. Jones, an alternative for the MVC pattern that focuses on a more clear request to response flow for web applications.

https://jenssegers.com/85/goodbye-controllers-hello-request-handlers

Read more

A trait to dynamically add methods to a class

Original – by Freek Van der Herten – 4 minute read

We recently released our newest package called macroable. It contains a trait that, when applied to class, can dynamically add methods to that class. This trait is basically a stand alone version of the macroable trait in Laravel. In this post I'd like to show you how you can use it, how it works…

Read more

iTerm2 leaks everything you hover in your terminal via DNS requests

Link –

iTerm2, a populair terminal app, contained a very bad security issue. Everything you hover over was being checked if it was a clickable url. To determine if it's a valid url, the hovered over string was being checked against DNS server. So if you hover over a password, or a secret key or whatever it sent out to the internet. Obviously this is a big problem. It's fixed in the latest version. So if you use iTerm2 and haven't updated it recently, be sure to do it now! The problem is fixed in version 3.1.1.

iTerm2's leak issue was first discovered ten months ago. iTerm2's creator initially reacted by adding an option to iTerm 3.0.13 that allowed users to disable DNS lookups. The feature remained turned on by default for new and existing installations.

Dutch developer Peter van Dijk, software engineer for PowerDNS, a supplier of open-source DNS software and DNS management service, re-reported this feature and this time around, he pointed out some of the severe privacy leaks not included in the first bug report.

"iTerm sent various things (including passwords) in plain text to my ISP's DNS server," van Dijk wrote flabbergasted in a bug report he filed earlier today.

This time around, George Nachman, iTerm2's maintainer, understood the severity of the issue right away and released iTerm2 3.1.1 to fix the problem within hours. He also apologized for enabling this feature by default without analyzing possible consequences in more depth.

https://www.bleepingcomputer.com/news/security/iterm2-leaks-everything-you-hover-in-your-terminal-via-dns-requests/

Read more

Event Sourcing: what it is and why it's awesome

Link –

If you haven't heard about event sourcing or are unsure about what it is, Barry O Sullivan has got you covered. Recently he wrote up a blogpost that explains it very clearly.

Event Sourcing (ES) is opposite of this. Instead of focussing on current state, you focus on the changes that have occurred over time. It is the practice of modelling your system as a sequence of events. ... It solves all the big problems our team has faced when building large scale distributed business software. It allows us to talk to the business in their language, and it gives us the freedom to change and adapt the system with ease.

https://dev.to/barryosull/event-sourcing-what-it-is-and-why-its-awesome

Read more

Five Vuex plugins for your next project

Link –

On the vuejsdevelopers.com blog Anthony Gore suggested a few cool Vuex plugins that could come in handy.

There are a lot of good reasons to use Vuex to manage the state of your Vue.js app. For one, it’s really easy to add super-cool features with a Vuex plugin. Developers in the Vuex community have created a tonne of free plugins for you to use, with many of the features you can imagine, and some you may not have imagined.

In this article, I will show you five feature that you can easily add to your next project with a Vuex plugin.

https://vuejsdevelopers.com/2017/09/11/vue-js-vuex-plugins/

Read more

Messing around with HTTP status codes

Link –

The HTTP specification says that status codes should be three digits integers, but what happens if they are not? April King, head of website security at Mozilla, did some fun experiments to find out.

While it is easy to create test cases for conditions that don't satisfy this requirement, it is somewhat more difficult to determine how third-party libraries will handle HTTP requests that fall outside this constraint. I looked around the internet for websites to help me test weird status codes, but most of them only let me test with the known status codes. As such, I decided to add arbitrary HTTP status codes to my naughty httpbin fork, called misbehaving.site.

What I discovered is that the various browser manufacturers have wildly different behavior with how they handle unknown HTTP status codes.

https://pokeinthe.io/2017/09/14/http-status-code-handling/

Read more

Prepare your website for iPhone X

Link –

Last week Apple introduced their new fancy iPhone X. It's screen has a top notch that might cause some problems in landscape mode. Stephen Radford explains how to properly handle it.

The new iPhone X features a beautiful edge-to-edge display. Well, almost. There is the small issue of a notch at the top of the browser which doesn't cause an issue when viewing websites in portrait but by default does cause some issues in landscape.

To accommodate the notch iOS 11 constrains websites within a "safe area" on the screen. On most websites this results in letterboxing on the left and the right.

http://stephenradford.me/removing-the-white-bars-in-safari-on-iphone-x/

We've already implemented the fix in our Laravel application template.

Read more