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

SitePoint PHP Blog:
Liking, Watchlisting and Uploading through Vimeo’s API
Nov 26, 2015 @ 10:26:40

The SitePoint PHP blog continues their series looking at using the Vimeo API from PHP with the second part of their series, enhancing the previous functionality. In this new tutorial they show you how to hook in to the Vimeo API and "like" videos, add them to watchlists and even push them through as uploads.

In a previous post, we used the Vimeo API to build a rudimentary video application with Silex and Twig. We added login and user feed functionality and wrapped it all up with a video searching feature. In this one, we’ll add in liking a video, adding a video to a watchlist for later, and uploading videos via the Vimeo API.

You'll need to have the functionality from part one in place first. From there they take off running, showing you how to interact with videos to perform the "like" and "add to watchlist" actions. The interaction with the API is fired from Javascript on the page and passed through a backend script through to the API. They follow this with the handling for the uploads, using a standard file upload form for input with a few validations once submitted. The code then uses the library to pull in the contents of the file and push it through to the API.

tagged: vimeo api tutorial part2 series watchlist like upload video

Link: http://www.sitepoint.com/liking-watchlisting-and-uploading-through-vimeos-api/

Programming With Yii2: Using the Advanced Application Template
Nov 24, 2015 @ 10:10:47

NetTuts.com has continued their series around programming with the Yii2 framework in this latest tutorial looking at the use of the Advanced Application Template, an enhanced boilerplate system that provides a bit more built-in functionality than the default application setup.

In this Programming With Yii2 series, I'm guiding readers in use of the Yii2 Framework for PHP. As you begin to use Yii for real development, you may want to start your next project with its Advanced Application Template. Among other things, it provides integrated user management features as well as two applications, one for the consumer-facing front end and the other, an administrative back end.

In this tutorial, I'll introduce you to the Yii2 Advanced Template and guide you through the basic setup and usage.

They start with a look at how the Advanced Template is different from the default one (a checklist) and how to set up a new project using it. They show how to configure the database connection and execute the required migration to build out the user table. They also walk you through the Apache setup for local development and what the resulting "Congratulations" page should look like. The remainder of the post explores the user management section, showing how to configure email delivery, signup, login and password reset requests.

tagged: yii2 framework series advanced application template user management tutorial

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-using-the-advanced-application-template--cms-24994

Alfred Nutile:
Laravel Training: The Laravel Maven and the Laravel Novice
Nov 11, 2015 @ 11:09:22

Alfred Nutile has posted information about a series of Laravel-related training videos that aim to help you go from "Laravel 0 to Deploy" as they walk you through the creation and deployment of a simple blog based on the Laravel framework features.

The two of us come together in this raw footage of building a Blog in Laravel. You get both the insights of an experienced Laravel Software Writer (Alfred Nutile) and the questions of a WordPress developer new to Laravel, (Joe Bacal)

As of the time of this post there's four episodes in the series with more planned:

Other topics to come include working with Homestead, managing Gulp dependencies, creating a contact form and working with single page applications.

tagged: laravel training screencast introduction beginner video series blog application

Link: https://alfrednutile.info/trainings/laravel

Jon LeMaitre:
Separation of Concerns with Laravel’s Eloquent (Series)
Nov 10, 2015 @ 09:10:47

Jon LeMaitre has written up a series of posts talking about effective separation of concerns using Eloquent, the database access component of the Laravel framework. His goal is to show you how makes use of the library and keep your application both maintainable and readable.

Eloquent (and by extension, Laravel) is often criticized because of its ActiveRecord ORM implementation, and that DataMapper produces a cleaner, more maintainable architecture in the long run. [...] This combination of behaviors crammed into a single object in itself is not the problem (in fact, it’s a wonderful asset), the problem is in how you make use of those behaviors throughout your application. You can be sloppy with them, or you can be tidy with them.

He starts with the "sloppy approach" where different methods of accessing the objects (and their data) are spread all across the application. He counters this with the tidy approach that makes use of "persistence-agnostic 'POPOs'" to hide the logic behind repositories. In the second part of the series he starts in and puts this idea into practice, using a simple "Member" table and model and repository classes to abstract the logic. Finally, in part three he gets into some more extended functionality for the repositories approach: handling collections, relations, eager loading and schema changes.

tagged: laravel eloquent designpattern repository orm datamapper activerecord abstraction tutorial series

Link: https://medium.com/laravel-news/separation-of-concerns-with-laravel-s-eloquent-part-1-an-introduction-c9a6dc6b4a65#.o0qsccqos

Master Zend Framework:
How to Test Zend Framework Applications with Codeception - Part Two
Oct 26, 2015 @ 09:31:13

The Master Zend Framework site has posted the second part of their tutorial series showing how to test Zend Framework applications with CodeCeption, a tool allowing for behavior-driven testing methods on PHP applications. In part two of the series they finish up the examples from part one and put them to use.

In part one of this series on testing Zend Framework applications with Codeception, we covered what Codeception is, how to install and configure it, and how to enable and configure the Zend Framework 2 module; finishing up by writing some basic acceptance and functional tests. [...] Here, in part two of the series we see how to retrieve and test registered services using BDD-style testing. This isn't going to be an exhaustive look at every possibility of what's available. Instead, what I'm going to do is show a simple set of examples which use two extra modules which come with Codeception and how they enable descriptive, BDD-style, tests.

The tutorial starts by getting into a bit more detail on what BDD-style testing is and some of the basic terminology. They help you install two modules to help make writing your tests simpler. The tutorial walks you through generating a new test for a fictional "Video" table gateway class and how to flesh it out to pull the service from the service manager, configure the database connection and write a few checks to verify the type of the service fetched and the number of records it returns.

tagged: zendframework2 service test bdd behavior codeception series part2 tutorial testing

Link: http://www.masterzendframework.com/testing-with-codeception-part-two/

PHP Security Video Series on YouTube
Oct 21, 2015 @ 10:49:02

As is mentioned in this quick post Codecourse (formerly PHP Academy) has posted a series of free videos to YouTube that aim to help you increase the security of your PHP applications. These videos go beyond the usual OWASP Top 10 you'll see in most security-related resources and dive into both some "old favorites" and some new interesting topics.

This YouTube series from Codecourse gives you a good overview of the most common PHP security issues. They use a very practical approach, showing how the attacks are done and how to protect your code from them.

Topics covered in the video series include things like:

There's ten videos in the series with a total run time of about an hour. They're split up for great bite-sized viewing chunks, so be sure to check them all out and see what you can learn.

tagged: codecourse phpacademy security video series youtube tutorial

Link: https://www.youtube.com/playlist?list=PLfdtiltiRHWFsPxAGO-SVPGhCbCwKWF_N

Pusher Blog:
How to Build Real-Time Laravel Apps with Pusher
Sep 23, 2015 @ 10:22:31

The Pusher blog has posted the set of tutorials they created as a part of the Laracon EU conference that shows you how to use their service to create a real-time Laravel-based application - a simple chat application.

The Laravel framework and Pusher are a great combination. Laravel helps you build elegant applications and at warp speed; Pusher helps you add real-time features to those apps in a fraction of the time it would take to build using your own infrastructure. [...] We recently wrote a set of tutorials covering How to Build Real-Time Laravel Apps with Pusher as part of a Workshop for Laracon EU. We’ve now opened up these tutorials for everybody and anybody to work through. The source has been opened up under the Commons Attribution 4.0 International License so you’re free to fork and adapt to suit your needs or even to run your own workshop.

The talk briefly about who the tutorials are targeted at and how the guide is laid out (a Gitbook). It covers some of the fundamentals of Pusher, setting it up via a Laravel bridge, debugging tips and the construction of the actual sample application.

tagged: pusher realtime application tutorial series gitbook chat laravel

Link: https://blog.pusher.com/how-to-build-real-time-laravel-apps-with-pusher/

SitePoint PHP Blog:
Drupal 8 Third Party Settings and Pseudo-Fields
Sep 15, 2015 @ 12:25:45

The SitePoint PHP blog continues their series looking at Drupal 8 with this new article from Daniel Sipos about third-party settings and pseudo-fields. Part one of the series can be found here

In the first installment of this series we started our journey towards creating some simple but powerful functionality. The goal we set was to have the possibility to load a form on each node page and to be able to choose which form type should be used on the different node bundles. [...] It follows to see how we can configure the core node types to use one of the plugins defined on the site and how to render the relevant form when viewing the node. But first, in order to have something to work with, let’s create our first ReusableForm plugin that uses a very simple form.

He starts back in with the creation of a first simple plugin to handle the form created in the previous part of the series, assigning the form to it via annotations. He then configures the node entities to be able to use the plugin via the services YAML configuration file. He then updates the .module with a function for altering node details and an entity builder. He updates the schema definition to be able to show the form and, finally, render the form out to the view with the assigned node entity types.

tagged: drupal8 series part2 thirdparty settings pseudofields form tutorial

Link: http://www.sitepoint.com/drupal-8-third-party-settings-and-pseudo-fields/

Matt Stauffer:
ACL (Access Control List) Authorization in Laravel 5.1
Sep 10, 2015 @ 09:41:45

Matt Stauffer has continued his series looking at Laravel 5.1 with a new post covering the ACL functionality recently added in 5.1.1. This functionality adds on to the pre-existing authentication handling that has been a part of the framework for a while.

The authentication that Laravel provides out-of-the-box makes it simple to get user signup, login, logout, and password resets up and running quickly and easily.

But if you needed to control access to certain sections of the site, or turn on or off particular pieces of a page for non-admins, or ensure someone can only edit their own contacts, you needed to bring in a tool like BeatSwitch Lock or hand-roll the functionality, which would be something called ACL: Access Control Lists, or basically the ability to define someone's ability to do and see certain things based on attributes of their user record. Thankfully, Taylor and Adam Wathan wrote an ACL layer in Laravel 5.1.11 that provides this functionality without any added work.

He talks about the main interface to the ACL system, the Gate class/facade, and gives a simple example of it in use. He then gets into how it works in defining abilities and checking access levels with both the facade and on the model level. He also shows how to use the checks in Blade templates and how to intercept the evaluations for custom evaluation. He ends the post talking about the concept of policies and controller authorization to allow for additional checking.

tagged: acl accesscontrol authorization laravel5 tutorial series part12 gate

Link: https://mattstauffer.co/blog/acl-access-control-list-authorization-in-laravel-5-1

Social Network with PHP: Introduction (Video Series)
Aug 28, 2015 @ 11:50:47

Codecourse.com has released a video series walking you through the creation of a simple social network site with PHP, Laravel and Bootstrap.

[This tutorial shows you how to create] a social network built with Laravel and Bootstrap. Authenticate, add and accept friend requests, post to a timeline, reply to and like statuses.

The videos are pretty "bite sized" at just a few minutes each, but they walk you through all of the code you'll need to get the site up and running as well. There's 36 videos in the playlist but with the playlist on auto-play you'll go through them quickly.

tagged: playlist video tutorial series screencast social network laravel bootstrap

Link: https://www.youtube.com/playlist?list=PLfdtiltiRHWGGxaR6uFtwZnnbcXqyq8JD