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

Laravel News:
Laravel 5.5 Will Be The Next LTS Release
Feb 21, 2017 @ 11:26:28

According to this quick post on the Laravel News site the next version of the framework that will get long term support (LTS) will be version 5.5:

Version 5.1 was Laravel’s first LTS release and its two-year window of bug fixes are coming to an end this year. There have been a few people questioning if another LTS would be released and version 5.5 would be the next in line if it did happen.

Just today Laravel announced on Twitter that Laravel 5.5 will, in fact, continue the LTS line. [...] Just as the previous LTS this will include two years of bug fixes and three years of security updates.

Long term support means that the version will be "feature locked" on release but will continue to get bugfixes for issues found until the end of the maintenance window is reached.

tagged: laravel lts longtermsupport version announcement laravel55

Link: https://laravel-news.com/laravel-5-5-lts

Laravel News:
Laravel Collection “tap” Method
Feb 20, 2017 @ 10:05:55

In this recent post to the Laravel News site Eric Barnes introduces a new method that's included in Laravel 5.4.10: the "tap" method.

Laravel 5.4.10 introduces a new tap method on collections which allow you to “tap” into the collection at a specific point and do something with the results while not affecting the main collection.

He includes an example, showing a sample array of user data and how, after converting it into a collection, he can "tap" into it at any point. He tapping pulls out the name of the current record following a "where" to locate the matching value. The quick post ends with a look at how the "tap" method is different from "pipe". Essentially the difference is that using "pipe" returns a different collection, potentially with modified data while "tap" does not.

tagged: laravel collection tap pipe method introduction

Link: https://laravel-news.com/collection-tap

Matt Stauffer:
Defining console commands via closure in Laravel 5.3
Feb 17, 2017 @ 11:06:37

Matt Stauffer has posted the latest article in his "New Features in Laravel 5.3" series today. In this new tutorial Matt focuses on the creation of console commands - additional functionality you can add in to the pre-existing "artisan" command handling.

Before Laravel 5.3, defining an Artisan console command—something like php artisan sync:dates—required you to create a new class for that command and register it in the Console Kernel. This is fine, but sometimes it feels like overkill for what might end up just being a single line of functional code.

As of Laravel 5.3, you'll notice that there's a new method in the Console/Kernel.php file named commands(), and it loads a new file at routes/console.php. This new "console routes" file allows us to define Artisan console commands with a single Closure instead the prior "define a class then register it in the console Kernel" flow. Much faster, much easier.

In v5.3 you define commands using "routes" along with a simple description using fluent statements. He shows how to add a simple command, one with input and a more streamlined example pulling values directly from the "route" signature.

tagged: laravel console commands closure v53 version tutorial route closure

Link: https://mattstauffer.co/blog/defining-console-commands-via-closure-in-laravel-5-3

Manage custom VM with Laravel Forge
Feb 15, 2017 @ 10:22:14

On the DotDev.co blog today there's a post from Jordon Brill showing you how to manage custom VMs with Laravel Forge. In his particular setup, the VMs he was working with weren't ones created by Forge so he needed to do some custom work to integrate the two.

I had a legacy php application that I wanted to move to a newer version of php. This application is not built on Laravel but rather is a conglomerate of a bunch of different php scripts and pieces of different frameworks. We recently deployed a Laravel-based application to a server running on AWS via Laravel Forge and Laravel Envoyer and fell in love with the service. We were completely up and running in about 10 minutes and it was great.

This case, however, was a bit outside of the typical scenario since it was not a Laravel application and Forge wasn’t going to be creating the server on one of the built-in services that Forge has an integration with (Linode, DigitalOcean, and AWS).

He starts by creating a new VM instance of a Ubuntu-based Linux system. He then shows how to connect it up to Laravel Forge via the "Custom VPS" option. This provides you with a custom command and token to use to make the connection to manage the server via Forge from then on. He does point out a few "gotchas": that it all needs to be run as the "root" account and that you'll need to open SSH ports in your firewall (if you have one) to allow the Forge service access.

tagged: laravel forge envoyer vm custom setup ubuntu tutorial

Link: https://dotdev.co/manage-custom-vm-with-laravel-forge-dc4c3218e415#.sehaglgkh

Nicola Malizia:
Understanding The Laravel Macroable Trait
Feb 14, 2017 @ 10:53:45

In this post to his site Nicola Malizia briefly helps you understand the Laravel "macroable" trait - what it is and how to can be used in your own code.

If you check the Laravel codebase I’m sure that you can observe that Laravel makes use of traits.

There is one trait in the source code that pulls my attention. I’m talking about the Macroable trait. In case you don’t know, you can define custom responses using macros.

He includes an example of extending the default Response class with a "caps" macro and how it would then be used in the resulting object. He talks about how traits work in PHP OOP code and how they can be used to "inherit" functionality into a class. The "macroable" trait then uses the __call magic method to do its thing, looking for macros that match the function being called.

tagged: macro macroable trait laravel example tutorial

Link: https://unnikked.ga/understanding-the-laravel-macroable-trait-dab051f09172#.g5xrqlk5s

Freek Van der Herten:
Packages that make developing Laravel apps easier
Feb 13, 2017 @ 09:46:12

Freek Van der Herten has a new post to his site sharing what he considers some of the most helpful Laravel package to help with your debugging.

In this post I’d like to share some of the packages that make developing a Laravel app easier.

His list of packages includes a wide range of testing tools like:

For each item on his list he includes a screenshot of it in action (either of a terminal or a UI) and a brief explanation of how it can help.

tagged: framework help debugging package laravel development

Link: https://murze.be/2017/02/packages-make-developing-laravel-apps-easier/

Creating a custom queue driver for Laravel
Feb 09, 2017 @ 19:21:04

On the DotDev.co blog there's a new post showing you how to create a custom queue driver for Laravel allowing you to define the logic and handling for background job processing with the framework.

Ever needed to use a queue service not supported by Laravel? No, me neither! However, recently I needed to tweak the config for the SQS driver in order to utilise a couple of the Amazon configuration settings. Unfortunately, these settings are not natively exposed by Laravel, so I decided to build my own driver. Here’s how it went.

The tutorial walks you through the creation of the queue class that extends the "Queue" interface already built into Laravel (and what methods it requires). It then mentions the custom connector class it'll require and the service provider to link it all together. There's also a section covering the configuration you'll need to define the queue properties and what changes you'll need to make.

tagged: tutorial custom queue driver laravel interface configuration serviceprovider

Link: https://dotdev.co/creating-a-custom-queue-driver-for-laravel-3ec6463fa881#.grumknpj8

Introducing Laravel Mix (new in Laravel 5.4)
Feb 09, 2017 @ 09:23:40

Matt Stauffer has posted the latest in his "What's new in Laravel 5.4' series with this new post covering Laravel Mix. Mix is a reworking of the Laravel Elixir package in previous framework releases but has changed a few things up in the process.

Laravel Mix. The same and yet entirely different from Laravel Elixir.

If you're not familiar with Laravel Elixir, it's a wrapper around Gulp that makes it really simple to handle common build steps—CSS pre-processing like Sass and Less, JavaScript processing like Browserify and Webpack, and more.

In Laravel 5.4, Elixir has been replaced by a new project called Mix. The tools have the same end goals, but go about it in very different ways.

He starts with a look at what's new about Mix and how it differs from previous version of Elixir. This includes changes in the structure of the configuration file, a different files/folders structure, helpers and quite a few other changes. Matt gets into detail on each item, providing code examples for the changes and a brief summary of how it's different for those that might have used Elixir before. Check out the full post for the full details.

tagged: laravel mix elixir css javascript compile helper v54 framework

Link: https://mattstauffer.co/blog/introducing-laravel-mix-new-in-laravel-5-4

Zend Framework Blog:
Using Laravel Homestead with Zend Framework Projects
Feb 07, 2017 @ 15:13:25

On the Zend Framework blog there's a new tutorial posted showing you how you can get Laravel Homestead and Zend Framework playing nicely together. Fortunately it's relatively easy to get set up with these two technologies, it "just works".

Laravel Homestead is an interesting project by the Laravel community that provides a Vagrant box for PHP developers. It includes a full set of services for PHP developers, such as the Nginx web server, PHP 7.1, MySQL, Postgres, Redis, Memcached, Node, and more.

One the most interesting features of this project is the ability to enable it per project. This means you can run a vagrant box for your specific PHP project. In this post, we'll examine using it for Zend Framework MVC, Expressive, and Apigility projects. In each case, installation and usage is exactly the same.

They walk you through the download of the Homestead Vagrant box and the vagrant-hostsupdater package to help with renaming the application's local hostname. An example Homestead configuration is included as well as information on how to test and ensure your setup is working as expected.

tagged: laravel homestead zendframework apigility

Link: https://framework.zend.com/blog/2017-02-07-laravel-homestead.html

Community News:
Announcing Laracon Online
Feb 07, 2017 @ 09:52:50

The Laravel News site has a new announcement posted about a new online-only conference for the Laravel (and general PHP) community: Laracon Online.

Laracon Online is a brand new one-day conference that will be held entirely online. This means no matter where you live you can now take part in Laracon. No hotels, no airfare, just signup and spend the day watching some of the best speakers right from your computer.

The speaker list includes Taylor Otwell, Jeffrey Way, Matt Stauffer, Adam Wathan, Evan You, Rachel Andrew, Nick Canzoneri, and Jason McCreary. Covering everything from new Laravel features to Vue.js, CSS, and more.

The event is happening on March 8th starting at 9am EST and will run all day until around 6pm EST. The schedule hasn't been posted yet (other than the session times) but Early Bird registration is open and tickets are available for only $10 USD. If you can't attend, all sessions will be recorded and will be available post-conference. For more information, check out the conference website.

tagged: laracon online conference laravel tickets

Link: https://laravel-news.com/announcing-laracon-online