<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://mattclements.co.uk/feed.xml" rel="self" type="application/atom+xml" /><link href="https://mattclements.co.uk/" rel="alternate" type="text/html" /><updated>2026-01-02T17:14:10+00:00</updated><id>https://mattclements.co.uk/feed.xml</id><title type="html">Matt Clements</title><subtitle>Web Developer from Milton Keynes</subtitle><entry><title type="html">Sagepay Updated SSL causing issues with PHP</title><link href="https://mattclements.co.uk/2021/03/25/sagepay-updated-ssl/" rel="alternate" type="text/html" title="Sagepay Updated SSL causing issues with PHP" /><published>2021-03-25T12:50:00+00:00</published><updated>2021-03-25T12:50:00+00:00</updated><id>https://mattclements.co.uk/2021/03/25/sagepay-updated-ssl</id><content type="html" xml:base="https://mattclements.co.uk/2021/03/25/sagepay-updated-ssl/"><![CDATA[<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Hi,<br />Our development teams have updated our security certificates in our Live environment. <br />You can access our site (<a href="https://t.co/5lQwoXMCGP">https://t.co/5lQwoXMCGP</a>) in a browser and pull the latest root certificate down for this.<br /><br />Apologies for any disruption this may have caused.</p>&mdash; Opayo Support (@OpayoSupport) <a href="https://twitter.com/OpayoSupport/status/1374747630555828225?ref_src=twsrc%5Etfw">March 24, 2021</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

<p>We had a Craft/Craft Commerce store that started throwing a warning yesterday:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ERROR! [CURL] 60: SSL CERTIFICATE PROBLEM: SELF SIGNED CERTIFICATE IN CERTIFICATE CHAIN [URL] HTTPS://LIVE.SAGEPAY.COM/GATEWAY/SERVICE/VSPSERVER-REGISTER.VSP
</code></pre></div></div>

<p>It turned out after much panicing that Sagepay had updated their SSL, and our implementation of Sagepay (using Omnipay/Guzzle) had a cached root certificate file which was failing validation.</p>

<p>We simply searched for the <code class="language-plaintext highlighter-rouge">cacert.pem</code> files (ours were located <code class="language-plaintext highlighter-rouge">vendor/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem</code>) and removed them. When browsing again, this re-cached the root certificates which resolved.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Hi,Our development teams have updated our security certificates in our Live environment. You can access our site (https://t.co/5lQwoXMCGP) in a browser and pull the latest root certificate down for this.Apologies for any disruption this may have caused.&mdash; Opayo Support (@OpayoSupport) March 24, 2021]]></summary></entry><entry><title type="html">Amazon Dash Doorbell</title><link href="https://mattclements.co.uk/2017/01/08/amazon-dash-doorbell/" rel="alternate" type="text/html" title="Amazon Dash Doorbell" /><published>2017-01-08T09:01:11+00:00</published><updated>2017-01-08T09:01:11+00:00</updated><id>https://mattclements.co.uk/2017/01/08/amazon-dash-doorbell</id><content type="html" xml:base="https://mattclements.co.uk/2017/01/08/amazon-dash-doorbell/"><![CDATA[<p>So, my weekend hack project came to me in the form of a tweet. Thanks to <a href="http://freelancegeek.co.uk">Christian Hambly</a> for the idea:</p>

<blockquote class="twitter-tweet" data-cards="hidden" data-lang="en-gb"><p lang="en" dir="ltr">My weekend project set, silent doorbell! : <a href="https://t.co/rbvz34P4As">https://t.co/rbvz34P4As</a><br /><br />Cc <a href="https://twitter.com/mattclementsuk">@mattclementsuk</a> <a href="https://twitter.com/bseymour">@bseymour</a></p>&mdash; Christian Hambly (@ChristianHambly) <a href="https://twitter.com/ChristianHambly/status/817626090919301120">7 January 2017</a></blockquote>
<script async="" src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

<p>Myself and my eldest set about installing Node, developing the required code <a href="https://github.com/initialstate/silent-doorbell/wiki">mainly based upon the original article</a>, and working with <a href="https://pushover.net">Pushover</a> which I have already used previously for notifications, the final code looks as follows:</p>

<figure class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">send_pushover_notification</span><span class="p">()</span> <span class="p">{</span>

  <span class="kd">var</span> <span class="nx">push</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span> <span class="dl">'</span><span class="s1">pushover-notifications</span><span class="dl">'</span> <span class="p">);</span>

  <span class="kd">var</span> <span class="nx">p</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">push</span><span class="p">(</span> <span class="p">{</span>
      <span class="na">user</span><span class="p">:</span> <span class="dl">"</span><span class="s2">xxxx</span><span class="dl">"</span><span class="p">,</span>
      <span class="na">token</span><span class="p">:</span> <span class="dl">"</span><span class="s2">xxxx</span><span class="dl">"</span>
  <span class="p">});</span>

  <span class="kd">var</span> <span class="nx">msg</span> <span class="o">=</span> <span class="p">{</span>
      <span class="na">message</span><span class="p">:</span> <span class="dl">"</span><span class="s2">Somebody is at the door!</span><span class="dl">"</span><span class="p">,</span>
      <span class="na">title</span><span class="p">:</span> <span class="dl">"</span><span class="s2">Doorbell</span><span class="dl">"</span><span class="p">,</span>
      <span class="na">sound</span><span class="p">:</span> <span class="dl">'</span><span class="s1">pushover</span><span class="dl">'</span><span class="p">,</span>
      <span class="na">priority</span><span class="p">:</span> <span class="mi">1</span>
  <span class="p">};</span>

  <span class="nx">p</span><span class="p">.</span><span class="nx">send</span><span class="p">(</span> <span class="nx">msg</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span> <span class="nx">err</span><span class="p">,</span> <span class="nx">result</span> <span class="p">)</span> <span class="p">{</span>
      <span class="k">if</span> <span class="p">(</span> <span class="nx">err</span> <span class="p">)</span> <span class="p">{</span>
          <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
      <span class="p">}</span>

      <span class="k">if</span><span class="p">(</span><span class="nx">result</span><span class="p">.</span><span class="nx">status</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
      <span class="p">}</span>
  <span class="p">});</span>

  <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
<span class="p">}</span>

<span class="kd">var</span> <span class="nx">dash_button</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">node-dash-button</span><span class="dl">'</span><span class="p">),</span>
    <span class="nx">dash</span> <span class="o">=</span> <span class="nx">dash_button</span><span class="p">(</span><span class="dl">'</span><span class="s1">xx:xx:xx:xx:xx:xx</span><span class="dl">'</span><span class="p">),</span>
    <span class="nx">exec</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">child_process</span><span class="dl">'</span><span class="p">).</span><span class="nx">exec</span><span class="p">;</span>

<span class="nx">dash</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="dl">'</span><span class="s1">detected</span><span class="dl">'</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="dl">'</span><span class="s1">Button pushed!</span><span class="dl">'</span><span class="p">);</span>

    <span class="nx">send_pushover_notification</span><span class="p">();</span>
<span class="p">});</span>


<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="dl">'</span><span class="s1">Ready</span><span class="dl">'</span><span class="p">);</span></code></pre></figure>

<p>We have a server fitted in the loft which I installed Node onto, then <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04#install-pm2">installed PM2</a> in order to run the application as a service.</p>

<p>The eldest installed <a href="https://pushover.net">Pushover</a> on his iPod Touch which means he knows exactly when the doorbell rings!</p>

<p>The final result:</p>

<p><img src="/assets/img/2017/01/doorbell.jpg" alt="Doorbell" /></p>

<p>Also worth considering when it comes out in the UK <a href="https://www.amazon.com/dp/B01C7WE5WM">Amazon IOT Button</a></p>]]></content><author><name></name></author><summary type="html"><![CDATA[So, my weekend hack project came to me in the form of a tweet. Thanks to Christian Hambly for the idea:]]></summary></entry><entry><title type="html">Apple Energy</title><link href="https://mattclements.co.uk/2016/06/10/apple-energy/" rel="alternate" type="text/html" title="Apple Energy" /><published>2016-06-10T05:58:35+00:00</published><updated>2016-06-10T05:58:35+00:00</updated><id>https://mattclements.co.uk/2016/06/10/apple-energy</id><content type="html" xml:base="https://mattclements.co.uk/2016/06/10/apple-energy/"><![CDATA[<p>Seth Weintraub, 9to5Mac:</p>

<blockquote>
  <p>Apple has quietly created an energy subsidiary, “Apple Energy” LLC, registered in Delaware but run from its Cupertino headquarters. The company was seemingly formed to allow it to sell excess electricity generated by its solar farms in Cupertino and Nevada, with plans to sell electricity across the whole of the US.</p>
</blockquote>

<p>I guess it makes sense, to cover their own needs and sell any excess back. It will be interesting to see what rolls out across the rest of the world (if anything).</p>

<p>And who says that Apple aren’t a services company…?</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Seth Weintraub, 9to5Mac:]]></summary></entry><entry><title type="html">New Apple Store designs</title><link href="https://mattclements.co.uk/2016/05/22/new-apple-store-designs/" rel="alternate" type="text/html" title="New Apple Store designs" /><published>2016-05-22T07:18:03+00:00</published><updated>2016-05-22T07:18:03+00:00</updated><id>https://mattclements.co.uk/2016/05/22/new-apple-store-designs</id><content type="html" xml:base="https://mattclements.co.uk/2016/05/22/new-apple-store-designs/"><![CDATA[<p>I love the new design planned, would like to see these worldwide</p>

<p><img src="/assets/img/2016/05/image.jpeg" alt="" /></p>

<p><a href="http://www.theverge.com/2016/5/19/11715726/apple-flagship-store-opening-san-francisco-photos">Photos from The Verge</a></p>]]></content><author><name></name></author><summary type="html"><![CDATA[I love the new design planned, would like to see these worldwide]]></summary></entry><entry><title type="html">Cascading soft deletes with Eloquent</title><link href="https://mattclements.co.uk/2016/05/14/post-post/" rel="alternate" type="text/html" title="Cascading soft deletes with Eloquent" /><published>2016-05-14T11:15:57+00:00</published><updated>2016-05-14T11:15:57+00:00</updated><id>https://mattclements.co.uk/2016/05/14/post-post</id><content type="html" xml:base="https://mattclements.co.uk/2016/05/14/post-post/"><![CDATA[<p>I can see an awesome use for this <a href="https://dyrynda.com.au/blog/cascading-soft-deletes-with-laravel-and-eloquent">Laravel Package</a></p>]]></content><author><name></name></author><summary type="html"><![CDATA[I can see an awesome use for this Laravel Package]]></summary></entry><entry><title type="html">Laravel bypassing CSRF for certain routes</title><link href="https://mattclements.co.uk/2015/06/17/laravel-bypass-csrf/" rel="alternate" type="text/html" title="Laravel bypassing CSRF for certain routes" /><published>2015-06-17T22:09:59+00:00</published><updated>2015-06-17T22:09:59+00:00</updated><id>https://mattclements.co.uk/2015/06/17/laravel-bypass-csrf</id><content type="html" xml:base="https://mattclements.co.uk/2015/06/17/laravel-bypass-csrf/"><![CDATA[<blockquote>
  <p>Laravel has CSRF enabled by default for all requests that come through your app. This is included and handled automatically to make life easier.</p>

  <p>However, one issue that comes up is when you are using external services where you do not have the ability to set a token. An example of this is with web hooks from third parties.</p>

  <p><a href="https://laravel-news.com/2015/06/excluding-routes-from-the-csrf-middleware/">Read more at Laravel News</a></p>
</blockquote>

<p>What an awesome addition to Laravel</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Laravel has CSRF enabled by default for all requests that come through your app. This is included and handled automatically to make life easier. However, one issue that comes up is when you are using external services where you do not have the ability to set a token. An example of this is with web hooks from third parties. Read more at Laravel News]]></summary></entry><entry><title type="html">Ladies and gentlemen, I shit you not: Phil Schiller</title><link href="https://mattclements.co.uk/2015/06/16/the-talk-show-wwdc-2015/" rel="alternate" type="text/html" title="Ladies and gentlemen, I shit you not: Phil Schiller" /><published>2015-06-16T22:13:39+00:00</published><updated>2015-06-16T22:13:39+00:00</updated><id>https://mattclements.co.uk/2015/06/16/the-talk-show-wwdc-2015</id><content type="html" xml:base="https://mattclements.co.uk/2015/06/16/the-talk-show-wwdc-2015/"><![CDATA[<p>An absolutely brilliant episode of <a href="http://daringfireball.net/thetalkshow/">The Talk Show</a> by <a href="http://daringfireball.net/">John Gruber</a></p>

<ul>
  <li><a href="http://daringfireball.net/thetalkshow/2015/06/09/ep-123">Podcast &amp; Video</a></li>
  <li><a href="http://www.imore.com/gruber-and-schiller-our-full-transcript-talk-show-wwdc">Transcript</a></li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[An absolutely brilliant episode of The Talk Show by John Gruber]]></summary></entry><entry><title type="html">Testing within Laravel 5.1</title><link href="https://mattclements.co.uk/2015/06/16/testing-within-laravel-5-1/" rel="alternate" type="text/html" title="Testing within Laravel 5.1" /><published>2015-06-16T21:04:03+00:00</published><updated>2015-06-16T21:04:03+00:00</updated><id>https://mattclements.co.uk/2015/06/16/testing-within-laravel-5-1</id><content type="html" xml:base="https://mattclements.co.uk/2015/06/16/testing-within-laravel-5-1/"><![CDATA[<blockquote>
  <p>Jeffrey Way’s fantastic Integrated package has given integration tests in Laravel superpowers for a while now, and it’s now a part of the Laravel core.</p>

  <p><a href="https://mattstauffer.co/blog/better-integration-testing-in-laravel-5.1-powerful-integration-tests-in-a-few-lines">Matt Stauffer</a></p>
</blockquote>

<p>Awesome to see this land within Laravel 5.1 and nice to see Laravel lowering the barrier to entry for testing.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Jeffrey Way’s fantastic Integrated package has given integration tests in Laravel superpowers for a while now, and it’s now a part of the Laravel core. Matt Stauffer]]></summary></entry><entry><title type="html">Switching a team to a framework</title><link href="https://mattclements.co.uk/2015/05/31/switching-a-team-to-a-framework/" rel="alternate" type="text/html" title="Switching a team to a framework" /><published>2015-05-31T21:57:30+00:00</published><updated>2015-05-31T21:57:30+00:00</updated><id>https://mattclements.co.uk/2015/05/31/switching-a-team-to-a-framework</id><content type="html" xml:base="https://mattclements.co.uk/2015/05/31/switching-a-team-to-a-framework/"><![CDATA[<p>We recently embarked on a project where we new that things were a little different than our normal project:</p>

<ol>
  <li>The project needed some rapid development to push it into production as soon as possible</li>
  <li>Whilst rapid development was necessary, the project was going to be maintained ongoing by our small team</li>
  <li>We had only a very small number of external dependancies such as other codebases to interface with</li>
  <li>We had no external database administrators to maintain</li>
</ol>

<p>Previously we as a team had not used a “full-stack” framework within a team, writing mainly vanilla PHP code, often stemming back to PHP4 era; it was time for change!</p>

<hr />

<p>From a long hard review at the myriad of frameworks available we settled on <a href="http://laravel.com/">Laravel</a>, primarily due to the LTS that is coming with <a href="https://laravel-news.com/2015/05/laravel-announces-v5-1-will-be-lts/">Version 5.1</a> and the huge support from the community that Laravel is currently receiving.</p>

<p>We are building a large scale CRUD application, with a number of external applications hooking into this application (most of which are under our control) to follow our business needs.</p>

<h2 id="writing-less-code-to-do-more">Writing less code to do more</h2>

<p>We found that using Laravel meant that we wrote less code overall to achieve more. Our application is built around 2 main models which are very similar to each other, but with minor differences in their relationships with other models. Using a framework has allowed us to build reusable parts of our application which can be shared across these 2 models.</p>

<h2 id="improving-our-coding-quality">Improving our Coding Quality</h2>

<p>Using Laravel (or generally a framework) has massively improved our teams coding quality. Whilst using a framework does not instantly mean that the code is good quality, it requires you to think a little more about where your code sits in the stack, how it interacts with other parts of the application, and the chance for reusability and whether this is likely to be required and therefore should abstracted. We found this extra time to think, along with the ability to write less code meaning that our application is far better quality than it would have otherwise been.</p>

<h2 id="better-source-control">Better Source Control</h2>

<p>We have always struggled with keeping code maintainable, and managing our application in source control (especially as previously we had not kept the database in source control, and had to rely on diff-ing database exports to compare changes).</p>

<p>With using <a href="http://laravel.com/docs/5.0/migrations">Migrations</a> within Laravel we are now able to keep our Local, Staging &amp; Production environments correctly up to date, and manage any changes across a team.</p>

<h2 id="packages">Packages</h2>

<p>Having the huge number of packages available from the community both in the form of <a href="https://packagist.org/">“normal” composer packages</a> and <a href="http://packalyst.com/">Laravel specific composer packages</a> has meant that we can often use community provided code (and spend our time helping with these rather than re-developing our own) and rapidly develop our application.</p>

<hr />

<p>Overall the use of a framework (and specifically Laravel) has meant that our team has improved code quality, provided us with better management over our application and massively helped us rapidly develop our latest application!</p>]]></content><author><name></name></author><summary type="html"><![CDATA[We recently embarked on a project where we new that things were a little different than our normal project:]]></summary></entry><entry><title type="html">Your Tradebase</title><link href="https://mattclements.co.uk/2014/12/08/your-tradebase/" rel="alternate" type="text/html" title="Your Tradebase" /><published>2014-12-08T13:39:34+00:00</published><updated>2014-12-08T13:39:34+00:00</updated><id>https://mattclements.co.uk/2014/12/08/your-tradebase</id><content type="html" xml:base="https://mattclements.co.uk/2014/12/08/your-tradebase/"><![CDATA[<p>Front-End Development Project</p>

<p><img src="/assets/img/2014/12/Screen-Shot-2014-12-08-at-13-38-37-1.png" alt="Your Tradebase" /></p>

<p>Site: <a href="https://www.yourtradebase.com/">Your Tradebase</a>
Client: <a href="https://www.yourtradebase.com/">Your Tradebase</a>
Skills: Ruby on Rails, HTML5, CSS3, jQuery</p>]]></content><author><name></name></author><category term="portfolio" /><summary type="html"><![CDATA[Front-End Development Project]]></summary></entry></feed>