Sevalla is the all-in-one PaaS for your web projects. Host and deploy your applications, databases, object storage, and static sites. Enjoy advanced deployment pipelines, a complete database studio, instant preview apps, and one-click templates. The pricing is simple: no hidden fees, no seat-based pricing, and you pay only for what you use. Get real human support from developers.

Get started now with a $50 credit at Sevalla.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.

Everything new in Laravel 5

Link –

Back in September Taylor Otwell said that Laravel 4.3 would be renamed to Laravel 5 to reflect a directory change and “other interesting initiatives”. Since that announcement the excitement for Laravel 5 has been building and “other interesting initiatives” turned into almost two dozen new features to help developers be more productive.
Eric Barnes made a nice list of the most notable new goodies in Laravel 5. The shiny new version of the framework will be released next week.

Read more

Use BackupPC to create daily backups

Original – by Freek Van der Herten – 1 minute read

My current hosting provider, DigitalOcean, has a great backup service. It takes frequent snapshots of entire droplets and it's very easy to restore the snapshot quickly. Unfortunately backups are only taken once every week. For our clients this is not acceptable. If you only rely solely on the DO…

Read more

An SSL certificate chain resolver

Original – by Freek Van der Herten – 1 minute read

When installing an SSL certificate on your server you should install all intermediate certificates as well. If you fail to do so, some browsers will reported "untrusted" warnings for your site like this one: Searching and downloading those intermediate certificates can be a hassle. It…

Read more

Higher order programming

Link –

This weekend at the PHPBenelux 2015 conference I went to a session about higher order programming by Mathias Verraes. Higher-order programming is a style of programming that uses functions as values.

During the session Mathias demonstrated his Lamdalicious library. This library brings the principles of LISP to PHP. The talk was very fast paced and everything was live coded. PHP was misused to the fullest: global variables, error suppression, ... and there was lots of recursion going on. Basically he was constructing another language in PHP. During the talk there were lots of ooohhss and aaahhhss in the room, so I suspect I was not the only one enjoying it.

If you are intrigued by this, be sure to read his blog post on the subject. The blog post is essentially the written down version of the talk.

You'll never use any of this code in production, but that's not the goal of the library. Like when doing code katas, the train of thought is much more important than the result.

Here's another wonderful blog post.

Read more

Generate image manipulations in a Laravel project

Link –

Earlier this month Glide joined The League of Extraordinary Packages. This package provides an easy way to generate image manipulations on the fly. Within a couple of hours I had integrated this wonderful package into both my company's legacy and current CMS.

The current CMS is based on Laravel. The Glide-integration is now available as a package on github: freekmurze/laravel-glide.

Installation

Nothing too fancy, you’ll have to:
  • use composer to pull in the package
  • install a service provider
  • install a facade
  • publish a config file
Read the specifics on Github.

Usage

Assuming you've got an image named `kayaks.jpg` in `app/storage/images` (this directory can be customized in the config file) you can use this code in a blade view:

<img src=&quot;{{ GlideImage::setImagePath('kayaks.jpg')->setConversionParameters(['w'=> 50, 'filt'=>'greyscale']) }}&quot; />

The function will output an URL to a greyscale version of kayaks.jpg that has a width of 50 pixels. As soon as the URL gets hit by your browser, the image will be generated on the fly. The generated image will be saved in app/storage/glide-cache (= the cache directory specified in the input file).

The generated URL will also be signed to prevent jerks from generating unwanted manipulations.

The setConversionParameters-function accepts an array with conversion options. You can take a look at the image API of Glide to see which options are available.

It's also possible to generate an image directly on the server:


GlideImage::setImagePath('kayaks.jpg')
    ->setConversionParameters(['w'=> 50, 'filt'=>'greyscale'])
    ->save($fileWhereImageManipulationMustBeSaved);

Read more

SSL certificate chain resolver

Link –

All operating systems contain a set of default trusted root certificates. But CAs usually don't use their root certificate to sign customer certificates. Instead of they use so called intermediate certificates, because they can be rotated more frequently.

A certificate can contain a special Authority Information Access extension (RFC-3280) with URL to issuer's certificate. Most browsers can use the AIA extension to download missing intermediate certificate to complete the certificate chain. This is the exact meaning of the Extra download message. But some clients (mobile browsers, OpenSSL) don't support this extension, so they report such certificate as untrusted.

A server should always send a complete chain, which means concatenated all certificates from the certificate to the trusted root certificate (exclusive, in this order), to prevent such issues. Note, the trusted root certificate should not be there, as it is already included in the system’s root certificate store.

This tools downloads all the intermediate certificates in the trust chain.

https://github.com/zakjan/cert-chain-resolver

Read more