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

Laravel News:
Installing Zend Z-Ray on Homestead
Aug 25, 2015 @ 10:45:01

On the Laravel News site there's a tutorial posted showing you how to Install the Zend Z-Ray tool on Homestead, the popular Laravel-related virtual machine environment. This tool helps with debugging applications by giving you an inside look (a sort of "x-ray") into its inner workings as it executes.

For the past week or so I have been running Zend Z-Ray in Laravel Homestead. Every time using it, new features come to light that are fantastic for debugging your apps in development! What follows is a quick preview of Z-Ray, along with all the steps necessary to install it on Laravel Homestead.

He talks some about the Z-Ray tool and the features it has to offer as well as some of the technologies it supports. He also covers some of the Laravel specific features included like project information, route inspection and current user information. He then gets into the Administration panel, what kinds of information it provides and, finally, how to get it all installed and working. It's not a super simple process but all the commands you'll need are included in the post.

tagged: install zray zend tool plugin laravel tutorial inspect

Link: https://laravel-news.com/2015/08/installing-zend-z-ray-on-homestead/

Laravel Podcast:
Episode 33: Post Laracon & Vices
Aug 20, 2015 @ 08:32:43

The latest episode of the Laravel podcast has been posted today with host Matt Stauffer and guests Taylor Otwell and Jeffrey Way - Episode #33: Post Laracon & Vices

In this episode, the team recaps Laracon, discusses a few of Matt's side projects, and details their juiciest vices.

You can listen to this episode either through the in-page audio player or by downloading the mp3 directly. If you enjoy the conversation and topics, be sure to also follow their feed and their Twitter account for announcements of future episodes. You can also check out their archive for plenty of past episodes.

tagged: laravel podcast ep33 laracon vices

Link: http://www.laravelpodcast.com/episodes/15896-episode-33-post-laracon-vices

Joe Ferguson:
On Community Silos
Aug 13, 2015 @ 10:17:30

Joe Ferguson recently attended the Laracon US conference, a conference centered around the Laravel framework and the community that's around it. In this post to his site he shares some of his thoughts about the event and something else that came up during the course of the event - the topic of "silos" in communities.

When the [JeoPHPardy] game was over I was thinking about a lot of the questions that the contestants couldn’t answer and how that relates to this being a Laravel conference. (As opposed to a PHP conference). [...] The point I’d like to make is that a random sampling of Laravel conference attendees were unable to answer medium to high difficulty PHP related questions. [...] I find it frustrating that a random sampling of Laracon attendees seem to be out of touch with not only notable PHP podcast hosts, the Framework Interoperability Group that is guiding the way they write code, and inner workings of the PHP language itself.

He goes on to share his frustration with the "silo" that it seems like the Laravel community has created, making their interactions with the general PHP community somewhat less. He points out that he's not picking on Laravel, though. He shifts the focus away from complaints about the community differences and instead emphasizes bringing people out of these silos. He includes a few practical things that can help too: attending a conference, going to a more general PHP user group, etc.

tagged: community laraconus15 conference involvement laravel silo encouragement

Link: http://www.joeferguson.me/on-community-silos/

Philip Brown:
Dealing with Exceptions in a Laravel API application
Aug 10, 2015 @ 11:57:43

In a post to his site Philip Brown shows a helpful way to manage API exceptions in a Laravel-based API application. In an API, exceptions are particularly important as they can be a hint to what the problem is and make it easier to return the correct error code to the client.

Exceptions are a very important method for controlling the execution flow of an application. When an application request diverges from the happy path, it’s often important that you halt execution immediately and take another course of action.

In today’s tutorial I’m going to show you how I structure my Laravel API applications to use Exceptions. This structure will make it very easy to return detailed and descriptive error responses from your API, as well as make testing your code a lot easier.

He starts with a brief introduction to HTTP status codes and their role in the interaction between client and server. He then gets into the "exception foundation" and how it will work, providing some basic common functionality (like throwing a 404 when a record isn't found, regardless of the type). He creates a configuration file to define the default error messages, an abstract Exception the custom instances can extend. He creates several of these as an example, such as a "UserNotFound" exception that extends the base "NotFound" exception class. He works with Laravel's own exception handlers and includes the code to catch a few different types inside.

tagged: exception laravel api application custom base handler tutorial

Link: http://culttt.com/2015/08/10/dealing-with-exceptions-in-a-laravel-api-application/

Laravel Podcast:
Episode 32: Adam Wathan Is Strong
Aug 07, 2015 @ 11:55:23

The Laravel podcast, hosted by Matt Stauffer with regular guests Taylor Otwell and Jeffrey Way, has posted their latest episode today - Episode #32: Adam Wathan Is Strong

In this episode, the crew discusses simple code, staying focused, Adam vs. The Hulk, and coding music.

You can listen to this latest episode either through the in-page audio player or by downloading the mp3 of the show. If you enjoy it, be sure to subscribe to their feed and follow them on Twitter to get updates on the latest episodes as they're released.

tagged: laravel podcast ep32 adamwathan strong simplicity focus music

Link: http://www.laravelpodcast.com/episodes/15117-episode-32-adam-wathan-is-strong

Matt Stauffer:
Login Throttling in Laravel 5.1
Aug 03, 2015 @ 08:35:57

Matt Stauffer has posted the eleventh part in his series looking at new features of the latest release of the Laravel framework (well, version 5.1). In this tutorial he shows you how to setup and configure the login throttling for your Laravel-based application with the help of the Laravel Throttle package.

Whether or not you know it, any login forms are likely to get a lot of automated login attempts. Most login forms don't stop an automated attack trying email after email, password after password, and since those aren't being logged, you might not even know it's happening.

The best solution to something like this is to halt a user from attempting logins after a certain number of failed attempts. This is called login throttling, or rate limiting. Graham Campbell wrote a great package called Laravel Throttle to address this in previous versions of Laravel, but in Laravel 5.1 Login throttling comes right out of the box.

He shows how to use the ThrottleTrait in your AuthController to have some of the "behind the scenes" work done for you. He shows you how to update your view to relay the possible error message back to the user (and includes a quick screencast of the result). He ends the post with a quick look at what the throttling functionality is doing under the covers: creating a temporary cache item based on username+IP address as a "lock" indicator. Finally, he points out two properties you can find on the auth controller to give a bit more detail on the current configuration: lockout time and max login attempts.

tagged: laravel login throttle tutorial authcontroller laravelthrottle package cache username ipaddress

Link: https://mattstauffer.co/blog/login-throttling-in-laravel-5.1

Laravel Podcast:
Episode 31: Public Speaking Preppers
Jul 29, 2015 @ 10:17:41

The Laravel Podcast, hosted by Matt Stauffer with guests Jeffrey Way and Taylor Otwell, has posted their latest episode - Episode #31: Public Speaking Preppers.

In this episode, the crew discusses preparing for conference talks, vacationing, and dreamy destinations!

You can listen to this latest post either through the in-page audio player or by downloading the mp3 directly. Be sure to subscribe to their feed or follow them on twitter for more information about the latest episodes as they're released.

tagged: public speaking preparation laravel podcast ep31

Link: http://www.laravelpodcast.com/episodes/14331-episode-31-public-speaking-preppers

SitePoint PHP Blog:
Validating your data with Respect Validation
Jul 20, 2015 @ 10:49:26

The SitePoint PHP blog has posted a tutorial showing you how to validate your data with Respect (well, their validation library) and ensure the data you're getting is exactly what you're expecting.

Validation is an important aspect of every application’s interaction with data. Instead of reinventing the wheel every time, the community collaborated on some useful packages like Symfony, Laravel, Zend, etc. In this article, we’re going to introduce a lesser known package called Respect Validation, which provides some nice new features.

He starts by mentioning some of the other popular validation packages used widely in the PHP community including the Symfony Validator and Laravel's Illuminate package. For each of these he shows code validating an email address, each with their own slight differences. Using this same example he shows how to implement it in the Respect library, first making use of their custom "email" validator class then via custom chained rules. He also shows how to set custom error messages and provides a more "real world" example with a simple Laravel application. His application takes in user data including username, password and credit card information and uses Respect's library to validate it via a full set of rules. He ends the post with a quick look at creating your own custom rule classes and how to "cross pollinate" them with Zend or Symfony validators.

tagged: respect validation library tutorial laravel example custom errormessage

Link: http://www.sitepoint.com/validating-your-data-with-respect-validation/

Freek Van der Herten:
Speed up a Laravel app by caching the entire response
Jul 20, 2015 @ 08:12:55

Freek Van der Herten has written up a tutorial for his site showing the Laravel users out there how to cache their entire response to speed up the overall performance of their application.

A typical request on an dynamic PHP site can do a lot of things. It’s highly likely that a bunch database queries are performed. On complex pages executing those queries and hydrating them can slow a site down. The response time can be improved by caching the entire response. The idea is that when a user visits a certain page the app stores the rendered page.

With a little help from his package it's easy to enable. Just install the package, add the service provider and you're ready to go. All successful responses will be cached unless told otherwise and cache files will be written out to files by default. He does point out that caching like this, while handy and a nice "quick fix" shouldn't be used in place of proper application tuning methods though. He also links to two other external technologies that could be used for the same purpose: Varnish and Nginx's own cache handling.

tagged: laravel application response cache output serviceprovider package

Link: https://murze.be/2015/07/speed-up-a-laravel-app-by-caching-the-entire-response/

Matt Stauffer:
Using Github authentication for login with Laravel Socialite
Jul 17, 2015 @ 10:17:25

In a tutorial posted to his site Matt Stauffer shows you how to integrate Laravel with GitHub's authentication to link a user's profile to your application, made possible through the Socialite package.

Laravel's Socialite package makes it simple to authenticate your users to Facebook, Twitter, Google, LinkedIn, GitHub and Bitbucket. You can authenticate them for the purpose of connecting their pre-existing user account to a third-party service, but you can also use it as your primary login mechanism, which we'll be talking about here. I'm working on a new little micro-SaaS that is purely dependent on GitHub in order to operate, so there's no reason to set up any user flow other than just GitHub.

He starts with just a bit of insight into the overall flow of an OAuth connection with an application (which this is) and the pieces involved. Next he helps you get Socalite installed and working with your Laravel application. With this in place he shows you how to create a simple GitHub application and configure your Laravel instance with the provided client ID/secret and redirect URL. He adds in some routes to handle the two page requests and the controller methods to process the input. He makes a simple "users" migration to hold user information and a model to match. Finally he shows the result, stepping through the authorization flow, complete with screenshots.

tagged: laravel github social authentication login socalite package tutorial

Link: https://mattstauffer.co/blog/using-github-authentication-for-login-with-laravel-socialite