How to fix PHP/PCRE unrecognised compile-time option bit(s) warning

We started to see the following warnings after upgrading to PHP 8.0.13. Despite only being warnings they cause the regex to fail and your application will probably error. preg_match(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 preg_replace(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 PHP 8.1-rc5 and 8.0.13 includes a patch for a performance

Using Docker secrets with Laravel

Docker secrets are a convenient and secure way of managing sensitive information that your containers need access to. More can be read on them over on the docker documentation. You may be tempted to set your config as environment variables when building your container, as The Twelve-Factor App encourages, but this isn’t secure when using docker containers

Laravel Unit & Dusk Tests on CircleCI

Recently put together a config for running unit and dusk tests for Laravel on CircleCI 2.0. Checkout the gist for nvm and composer scripts https://gist.github.com/iWader/6e2f81e6147676c3a7fd36a1c1e7ea3e version: 2 jobs: build: working_directory: /var/www environment: BASH_ENV: ~/.bashrc docker: – image: php:7.1-cli environment: APP_ENV=testing – image: circleci/mysql:5.7 environment: MYSQL_ALLOW_EMPTY_PASSWORD=true MYSQL_ROOT_HOST=”%” MYSQL_USER=root steps: – run: name: Install System Dependencies command:

Laravel Dusk pages with dynamic routes

Here's a quick demo to show how you can still use the Dusk pages with model specific routes. Lets say we have a CRM and you have a page that lets you view details of a single contact. The route might look something like http://my.crm/contacts/1 now you could manually navigate to that page, select some elements

Testing an Eloquent model's events

I recently ran into an issue when attempting to test a trait that registered events on an Eloquent model. After I done a little digging it turns out that events on the model are only fired when the event dispatcher is set. Of course the events dispatcher is part of a different package (illuminate/events) and isn't setup when working with individual illuminate components

Using HTTP/2 Server Push

Firstly, what is server push? HTTP/2 is a great advancement for the HTTP protocol, allowing multiple assets to be streamed over a single TCP connection. This reduces the need for “optimisation practices” such as domain sharding, image sprites, etc. There is one really cool feature of HTTP/2 however which can greatly speed up the render time of your website

Signing your git commits with your Keybase key

Keybase provides a convenient way to verify identities by signing things. One great use for this is signing your git commits and releases. To do this there's several steps we need to take: import your Keybase key into your local GPG keyring, configure git to sign commits using the key and finally add our GPG key to GitHub

Using Vue 2.0 with Vue-Router's history mode

I recently started a new side project and decided to start using Vue 2.0 seeing as it had now reached RC stage. Some plugins however aren’t quite at that point, and I found myself digging through a lot of source code to get things working. One of things I wanted to enable was yhe HTML pushstate, but the configuration options had changed and documentation has not yet been updated

tymon/jwt-auth with Lumen 5.2

Recently I’ve been developing a Vue.js site using JSON Web Tokens (or JWT) for the authentication. Theres been a long standing library for Laravel, tymon/jwt-auth. It’s never been greatly compatible with Lumen, never mind the shakeup with the auth system in 5.2. The author has however just released an alpha for version 1 which addresses the Lumen

Renault Zoe ‐ 2,000 Miles and counting

Back in April 2015 I started looking for a new car, something to replace my ageing 2004 Purgeot 206, so it had to be small, cheap to run and most importantly cheap to insure. Most usual factors to me aren’t important, I don’t have any kids so practicality and space isn’t a huge deal.