Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Dries Vints:
Laravel Horizon with Forge and Envoyer
Feb 15, 2018 @ 10:53:16

Dries Vints has posted a step-by-step guide for the Laravel users out there showing how to set up Laravel Horizon using Forge and Envoyer for the server management. Laravel Horizon is a frontend/backend interface for Laravel that makes working with Redis easier.

I recently installed Horizon for Laravel.io and while it wasn’t that hard to install, I still had to figure some things out. Since this was the first time setting everything up I thought I’d write up the steps to take to get started with Horizon and set everything up with Forge and Envoyer.

[...] Remember that this isn’t a guide that dives deep into Horizon, just enough to get it up and running. If you want more info about Horizon’s internals I suggest this excellent post by Mohamed Said.

The tutorial then walks through the six step process to get the full deployment flow set up:

  • Step 1: Installation
  • Step 2: Configuration
  • Step 3: Scheduler
  • Step 4: Authentication
  • Step 5: Envoyer
  • Step 6: Forge

When the setup and configuration is complete the deployment you'll end up with a Horizon environment ready to use. The post ends with a reminder for queue management and where to change the setting to be applied in the next deploy.

tagged: laravel horizon forge envoyer deployment setup configuration tutorial

Link: https://medium.com/@driesvints/laravel-horizon-with-forge-and-envoyer-82a7e819d69f

Caleb Porzio:
My VS Code Setup
Dec 14, 2017 @ 09:53:50

Caleb Porzio has put together a post for those out there either considering using Microsoft's Visual Code Studio IDE or just want to see what it would be like for PHP development. In his post he shares his setup since making the switch over to the IDE full time.

I’m using VS Code as my primary editor these days and am really digging it. My setup is by no means perfect, but I've made lots of little tweaks along the way that you may benefit from.

I've set up these nifty categories, so feel free to jump around and try stuff out as you go, or come back later and use it as a reference.

Categories in the post include useful extensions, "must-have" settings, changing up the look and useful keybindings. There's plenty of links, output examples, screenshots of the IDE and the configuration options you'll need to change to update the settings to match his.

tagged: visualstudiocode vscode ide setup configuration extension setting

Link: http://calebporzio.com/my-vs-code-setup-2/

Delicious Brains Blog:
Using VS Code for WordPress Development
Dec 05, 2017 @ 10:15:42

On the Delicious Brains site there's a tutorial that shows you how to use Microsoft's VS Code IDE for PHP development. They focus more specifically on WordPress development but a lot of the environment setup could be used for any PHP project.

If you keep up with the many different text editors and developer tools available, you may have heard of a newer IDE called Visual Studio Code. VS Code is a free, open source code editor that is lightweight like Sublime Text, but offers many of the same features as bigger IDEs like PhpStorm or WebStorm.

In this article I’ll review some features and extensions of VS Code that I really appreciate, and show you how to make the most out of it for WordPress and general web development.

The tutorial walks you through the installation and integration of various PHP development tools including an "intellisense" extension, XDebug support, a Javascript debugger and a few other helpful extensions. Install instructions are included as well as screenshots/screencasts showing the end result.

tagged: visualstudiocode vscode ide introduction installation setup debug integration wordpress

Link: https://deliciousbrains.com/vs-code-wordpress/

Youssouf El Azizi:
Laravel & Docker, Zero config with Vessel
Nov 28, 2017 @ 13:28:52

On the Hackernoon site Youssouf El Azizi has posted a quick tutorial showing you how to use Vessel with Docker and Laravel to create a "zero config" setup quickly and easily.

This article is a step-by-step to get started with Vessel ( the new way to setup the Laravel setup config with docker).

[...] Vessel is a lightweight docker environment for Laravel, that means it is just a small set of files that set up a local docker development environment per project and there is no extra thing to install globally, expect Docker system itself.

The tutorial then walks you through the process you'll need to follow to get the environment up and running including the installation of Docker/Docker-compose. It then walks through the installation of Vessel and what images (containers) it will set up when executed. The post ends with a "cheat sheet" you can use when working with Vessel providing some common commands.

tagged: tutorial laravel docker configuration setup vessel container

Link: https://hackernoon.com/laravel-docker-zero-config-with-vessel-60e1aa173ea8

Tim MacDonald:
Backup multiple sites and frameworks with 'Laravel Backup'
Nov 01, 2017 @ 10:56:19

In a new post to his site Tim MacDonald covers a Laravel backup package provided from Spatie and how to use it to backup your sites (and not just Laravel ones).

Using Spatie's Laravel Backup package you can backup several sites on a server from a single app install, including Laravel apps and WordPress sites.

Laravel Backup is a fantastic package brought to us by to ever awesome team at Spatie, and is only one of the many great packages they have in the wild. This package makes it super simple to backup your Laravel applications, including all your files and production database, to a 3rd party storage facility, such as Amazon S3.

He then describes his own setup, running a smaller server that hosts several of his sites that use Laravel, WordPress and static content. He needed a backup solution that would allow for him to manage backups for all of them. He then walks through the setup of the package and how to configure it for each site type. The post finishes with the command to execute and run the backup for the site and how to schedule it as a part of the recurring jobs handling.

tagged: laravel backup tutorial introduction setup configure wordpress static

Link: https://timacdonald.me/backup-multiple-sites-frameworks-laravel-backup/

BitPress Blog:
My Simple Approach to using Docker and PHP
Sep 20, 2017 @ 11:55:39

Paul Redmond has written up a tutorial sharing his simple approach to using Docker and PHP to provide a more robust development environment.

Getting started with Docker and PHP can still be a steep learning curve. You might feel that you don’t need something like Docker and that Vagrant or full local development work just fine. I still use local development on some projects because the barrier to entry is small.

You will likely face scenarios where you require different versions of PHP, work with multiple developers, and seek consistency between environments. When you’re working with a team, you need a consistent way to develop. I’ve been on teams where different versions of PHP and MySQL varied between developers. I want to show you how Docker can fill the gap of providing consistent development environments, and do so without a huge amount of added complexity.

He starts with some background on why he decided to learn how to use Docker for his PHP development and how it has helped simplify his setup. He then walks you through some of his initial steps with Docker, providing the commands to create a new Laravel project and the structure he uses for his projects and the base image. He covers the contents of the Dockerfile, the Apache VirtualHost setup and how to build out the image. The post also includes instructions for:

  • running Apache
  • running "docker compose"
  • adding a volume for local development
  • adding MySQL
  • running commands
  • how to connect to the MySQL instance running in the container

Each item on the list includes configuration changes and commands that you'll need to get everything set up and running in a simple Docker container on your system.

tagged: tutorial docker setup configuration environment introduction

Link: https://bitpress.io/simple-approach-using-docker-with-php/

Dragos Holban:
How to Setup Docker for Your Symfony Project
Sep 18, 2017 @ 11:48:31

In a tutorial posted to his Medium.com site Dragos Holban continues his series walking you through Symfony for PHP applications. In this latest part of the series he shows you how to use Docker to set up an environment for a Symfony-based application.

As you probably know, I am a big Symfony fan :) In the last few years I used Vagrant to set up my Symfony development environment more or less as described here. But we now have Docker and it’s time to move forward with a new setup. Docker containers are generally more lightweight than Vagrant virtual machines, so starting and stopping them is extremely fast. They also take a lot less disk space.

He starts by sharing an example Dockerfile and docker-compose.yml to help set up and configure the environment to be ready for use. The configuration sets up Apache, PHP 7, MySQL, git, Composer and several PHP extensions. It then installs a fresh instance of Symfony and runs a bash file to finish the setup. He shares the contents of this file and the VirtualHost configuration for the web server. Finally he shows how to run the setup via the Docker command line tool and what you can expect to see when things are running smoothly.

tagged: docker symfony setup configure dockerfile compose tutorial series

Link: https://medium.com/@dragosholban/how-to-setup-docker-for-your-symfony-project-ff9b1bf44e68

Delicious Brains Blog:
Behind-the-Scenes: How We’re Automating Acceptance Testing
Aug 15, 2017 @ 10:57:04

On the Delicious Brains site Ian has written up a lengthy post sharing how they automate their acceptance testing for their PHP applications.

Have you ever had the joy of carrying out acceptance tests? For our team at Delicious Brains, testing our releases, in the past, has been one of the most dreaded tasks on the to-do list. We hold our plugins to a high quality standard so it’s a must but manual tests are brain-numbingly tedious and can take hours of expensive developer time.

Recently, we decided it was high-time to fix that. [...] Read on for more about how the automation of testing our plugins ahead of release is shaping up – including how we manually tested in the past and a look at some of the automated acceptance tests we’ve already implemented.

He starts by defining what acceptance testing is and how they're different from other types of testing. He then shows the manual method they were using to run their tests previously and what prompted the move towards automation. He talks about the tools that they use for their automated testing including Codeception and Docker. Configurations and scripts are included that make the automation work and some of the issues they came across during the move from manual to automated processes.

tagged: automated testing codeception docker tutorial setup configuration manual

Link: https://deliciousbrains.com/how-were-automating-acceptance-testing/

Delicious Brains Blog:
How to Use Xdebug for Advanced PHP Debugging
Aug 07, 2017 @ 10:17:14

On the Delicious Brains site there's a tutorial posted that shows you how to use XDebug for advanced PHP debugging versus some of the usual practices of var_dump or print_r-ing your way through your testing.

You could just debug your PHP code using functions such as error_log, print, and var_dump, (and to be honest we’ve all done it, a lot!), but sometimes they just aren’t enough, and can actually slow you down while developing.

There must be a better way, surely?! Enter Xdebug, the rather awesome debugging and profiling tool for PHP.

In this post, I’ll take you through why Xdebug is amazing, getting it setup, how to use it, get the most out of it it, and some neat advanced uses all to make your life easier.

He starts with some background on his previous debugging practices and how discovering XDebug revolutionized his workflow. He then talks about breakpoints for debugging and what he calls "debug driven development". The article then walks you through the installation process and the integration with IDEs, specifically PHPStorm. The rest of the post shows examples of how to use XDebug along with breakpoints and IDE features to get more information about the current application state and where things are failing. He also includes sections about using XDebug for profiling and performing remote debugging via an SSH tunnel.

tagged: xdebug introduction debugging profiling tutorial setup ide integration

Link: https://deliciousbrains.com/xdebug-advanced-php-debugging/

Laravel News:
Homeboy Allows You to Automate Adding Sites to Homestead
Jul 10, 2017 @ 09:27:32

On the Laravel News site there's a quick post highlighting a tool that can be use to help automate adding sites to your local Homestead environment - Homeboy.

Homeboy is a new package for Laravel Homestead that allows you to add a new local development site quickly. Once you run the command line tool, it will update your host file to point your dev domain, update your Homestead.yaml file to include mapping to for the new project and create a database mapping, and finally, it’ll re-provision Vagrant.

The post also includes a screencast the project has shared showing the tool in use (though the choice of soundtrack is questionable). It basically works as a shortcut to adding the changes to the files yourself, making it simpler to spin up new sites and environments quickly.

tagged: homeboy laravel homestead environment setup configure tool

Link: https://laravel-news.com/homeboy-allows-you-to-automate-adding-sites-to-homestead