Categories
Development Security Tutorials

Signing Git Commits With A Keybase GPG Key

A relatively unknown and underused feature of Git is the ability to cryptographically sign commits. It is an optional feature that provides a way for the author of a commit to prove ownership. It uses the author’s GPG key to leave a signature in the commit that can be checked later. If you’re a Keybase […]

Categories
Development Tutorials

Getting Started with PHPUnit in Laravel

Note: I originally wrote and published this article as a Semaphore CI Community Tutorial. Introduction PHPUnit is one of the oldest and most well known unit testing packages for PHP. It is primarily designed for unit testing, which means testing your code in the smallest components possible, but it is also incredibly flexible and can […]

Categories
Development

Using Laravel 5 Middleware for Parameter Persistence

I am lucky enough to get to work on a large Laravel 5 full time in my day job, with some awesome developers.I recently came up with what is, in my humble opinion, an elegant and simple solution for what we all initiallythought was quite a complex problem. If you’ve used this trick before,or know […]

Categories
Development

php artisan serve for Laravel 5

Important: In an entertaining example of poor timing, Taylor Otwell added the serve command back into the framework shortly after I published this. There is now no need to use this package. Users of Laravel 4 will remember that it came with a fantastic little command:

Categories
Development

Laravel 4 Down Safe

Laravel is a fantastic PHP Framework that does most of the complex, and boring, application framework tasks for you, so you can focus on the application itself. One of the components it provides is a full Queue Worker system to make it very easy to add jobs into a queue and process them in the […]

Categories
Development

HTML5 Time Input and Chrome for Android Stupidity

For a project I’ve been working on, I needed to accept a time value input from users (for a timesheet). So I figured, what the hell, I’ll use the new HTML5 time input field (<input type=’time’ …>). It seemed to work perfectly when testing on my laptop with Chrome – a nice and simple time […]

Categories
Development

Sorting eager loaded records in Laravel's Eloquent.

Eloquent, which is Laravel’s ORM, has some really nice features. One of which is the [Eager Loading][eager]functionality that allows you to request all of the related records in one hit, to avoid having to makemultiple database calls for each iteration of a loop. Let’s look at a simple example which returns the latest 10 blog […]

Categories
Development

Limiting Belongs To Many database queries with Pivot table values in Laravel.

This post was updated on 2014-01-22. The Proposal that I mentioned in the original articlewas approved and then implemented by Taylor Otwell, and has since been released in Laravel 4.1.

Categories
Development

Automated backups of an on-demand MySQL database using automysqlbackup

Since I’m a PHP developer and I run Ubuntu on my laptop, I find it very easy to development directly on the machine. This means that my laptop also has PHP and MySQL running (and until the new PHP 5.4 dev server, Apache). While PHP doesn’t is only used on-demand, the MySQL server is a […]

Categories
Development Testing

How to automatically create testing databases (in PHP & MySQL)

If you use an automated testing platform (such as Jenkins) you may have come across the problem where you need to manually create a new database (and sometimes user) every time you configure a different build or a different host. For small projects it’s not much of a chore, but for larger projects (or complicated […]