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

Matt Stauffer:
The new Notification system in Laravel 5.3
Oct 20, 2016 @ 09:32:44

In the latest part of his series covering Laravel 5.3, Matt Stauffer has posted this new tutorial covering the new notification system in the latest version of the popular Laravel framework.

In a previous blog post I've covered Laravel's new Mailable feature, which introduces some important changes to how we send mail in Laravel. I'd recommend at least skimming it if you haven't read it yet. In short, the preferred mail syntax is no longer sending mail using the "classic" mail closures, but instead creating a "Mailable" class for each message you want to send—for example, the "WelcomeNewUser" mailable class.

In Laravel 5.3, we have another new feature for communicating with our users: Notifications.

This notification system makes it simpler to send messages to your user when you don't care as much how they get it, just that they do. He walks you through the creation of your first notification class and breaks it down into its main parts, explaining each one. He shows how to define the different handlers for the notification types (like "toEmail") and how to trigger the notification, passing in either a single user or all users in the system. He then talks about the channels that are available to notifications and how to integrate several including Nexmo, database and the "broadcast" channel.

tagged: laravel notification system tutorial introduction channel trigger

Link: https://mattstauffer.co/blog/the-new-notification-system-in-laravel-5-3

Larry Garfield:
Composer vs. Linux Distributions: A Mental Model Battle
Feb 25, 2016 @ 11:41:11

In his latest post Larry Garfield talks about the Composer problem that was recently brought up by the Gentoo linux project and is related to how Composer packages and system-level shared libraries differ.

This is not a new complaint; Other distributions have complained about Composer's impact before. But fundamentally I think the issue stems from having the wrong mental model of how modern PHP works when viewed from a distribution or sysadmin perspective.

In a recent heated GitHub thread, several people referred to PHP "linking" to 3rd party libraries, as if they were shared C libraries. That is simply not the case. Neither "static linking" nor "dynamic linking" really applies to PHP. From a sysadmin perspective, PHP is closer to highly complicated bash scripts than anything else.

Larry starts with a bit of history on the subject, pointing out the two methods most developers used PHP code: copy/pasted from the web or installed via PEAR. He talks about the common issues with both approaches. He then talks about how modern PHP development and Composer related and how, from a sysadmin perspective, Composer is the "compile" step of PHP and only supports static links. He also makes some suggestions to the distribution packagers around how to handle these system-level Composer dependencies (and how to treat it like a "binary" if needed).

The mistake here is trying to treat dependent packages of modern PHP applications like shared libraries. They're not. The community has spoken, and PHP simply doesn't work that way anymore. Fighting that is a losing battle. But by viewing composer as a compiler, distributions can still slot PHP into their typical workflows and get all of the security update ease that they're looking for.
tagged: composer linux distribution mental model shared library system dependency gentoo

Link: http://www.garfieldtech.com/blog/composer-distribution-mental-model

Symfony Finland:
What eZ Platform adds to Symfony
Feb 12, 2016 @ 10:44:01

On the Symfony Finland blog Jani Tarvainen has written up a new post sharing some of the things that eZ Platform adds to Symfony and what kind of functionality it brings with it on top of the usual Symfony featureset.

eZ Platform is a Content Management System built with the Symfony Full Stack framework. While this may be clear to developers who have worked with, it maybe somewhat vague for the unitiated, especially when compared with Concrete5 or Drupal, which have adopted Symfony components into their core. [...] The relationship between Symfony and eZ Platform is very similar to Expression Engine using Code Igniter or EPiServer using ASP.NET MVC.

He then goes on to talk about the things Symfony includes by default including the request/response structure, internationalization handling and Twig integration. From there he lists out the things that the eZ Platform adds on top of the standard Symfony including:

  • a content repository
  • dynamic routing
  • a user interface
  • user and permission management

He ends the post with a look at some of the other bundles and features eZ Platform also provides around HTTP caching, image manipulation and more.

tagged: ezplatform symfony project framework content management system

Link: https://www.symfony.fi/entry/what-ez-platform-adds-to-symfony

Statamic v2 Beta: First Impressions of a new Laravel-based flat-file CMS
Feb 01, 2016 @ 13:37:14

On the Tighten.co blog they've posted their own review of Statamic, the flat-file based content management system with a Laravel backend. Statamic is a project that hopes to provide easy content management, responsive layouts and plenty of features to make an easy-to-use and robust CMS.

Among the developers I know who used to use ExpressionEngine but have since left, most work in Craft and/or Laravel. I kept hearing folks mention Statamic, but all I knew about it was that it was flat file, which wasn't particularly compelling to me.

Fast forward two years, and they've re-written the entire application to run on Laravel (now released as v2 beta). [...] Their documentation is hilarious, the community is welcoming and helpful, and the code—granted, I'm only a few weeks in—seems super easy to work with. So, what's the deal? Why have we set up Tighten's blog on Statamic?

The post then goes on to talk about the "quest" for a good Laravel-based content management system. They also talk about some of the essentials they see a CMS needing to be effective: good user interaction (UI/UX), how much and how difficult it is to customize and how it is configured. For each point they talk about how Statamic does things and their own verdict on the software and how good it does at filling these requirements.

tagged: statamic beta laravel content management system cms flatfile

Link: http://blog.tighten.co/statamic-v2-beta-first-impressions-of-a-new-laravel-based-flat-file-cms

Zaengle Blog:
Laravel as an Intermediary
Dec 03, 2015 @ 11:11:21

In this tutorial on the Zaengle blog Jesse Schutt shows you how to use a Laravel application as an "intermediary" between several services and tie them together so a single action could kick off a series of events.

One of our clients recently came to us with the following workflow they'd like the Zaengle team to implement for them: They wanted to compose a blog entry in their CMS. Upon publishing of the entry, they wanted the content of the blog entry to be emailed to a filtered group of their customer database (stored in Marketo). Finally, they wanted to be able to track email metrics from within their customer database.

[...] After brainstorming with the team and client, we decided that since there were at least 3 different systems in play (CMS, Customer Database, & Mail Processor), we needed to write a custom application that would bring all of them together.

He then walks you through the solution they came up with, showing how it makes use of webhooks, API requests and work with their own database. He talks briefly about some of the benefits of the setup and how they arranged the testing of the data flow between the pieces of the system.

tagged: laravel intermediary multiple system process action

Link: http://zaengle.com/blog/laravel-as-an-intermediary

Coding.bmail.net Blog:
Advanced logging system in PHP for careful developers
Aug 05, 2015 @ 12:19:51

On the Coding.bmail.net blog they've posted a guide to what they've called an advanced logging system in PHP for careful developers - essentially a logging system that's as "error proof" as possible and that works with as little user exposure as possible.

Being aware of all the activity and problems under the hood is essential when running big websites with lots of users, many features and, as it is usual in such cases, weak spots that must not be left untracked.

In order to be the first in knowing when errors or other events of interest happen we need a well designed logs manager. My code will provide such a feature, for PHP based websites.

They briefly outline how the complete setup will work, failing back to email if the database connection isn' available and logging based on environment. It also includes error levels and, on development only, a method for showing the errors being logged. While a good bit of this functionality could be handled by something like Monolog they do include some additional features like the email fallback, output of the errors in development mode and custom error/exception handlers.

tagged: logging advanced system custom database email environment tutorial

Link: http://coding.bmain.net/tutorials/php/advanced_logging_system_in_php_for_careful_developers

SitePoint PHP Blog:
Symfony2 Pre-registration and Invite System
May 07, 2015 @ 08:25:48

The SitePoint PHP blog has kicked off a new series of posts today with part one of a set of tutorials showing you how to create a registration and invitation system with Symfony2. While they've talked about general Symfony2 development before, this series will focus more on the security side, on authentication and authorization.

In this article series of two parts, we are going to talk about a very important area of web application development: Authentication and Authorization. Symfony2 has a very detailed elaboration of these two topics in its official documentation. Anyone who is seriously looking into this is encouraged to read through that official document after absorbing the essentials from this tutorial.

The author starts with a brief list of common user management tasks including registration via a form, sending confirmation emails and verifying the user's login. He helps you create the underlying "user" table (complete with the SQL) and talks a bit about the contents of a few of the columns. He includes the settings you'll need to put into your "security.yml" configuration file and a bit of detail on what each section and its settings mean. He then moves on to the "User" entity and class file, adding some functionality to the standard generated class. He also includes the code needed to create the invite and registration actions.

tagged: registration invite system symfony2 tutorial user management authentication authorization

Link: http://www.sitepoint.com/symfony2-pre-registration-invite-system/

SitePoint PHP Blog:
Introducing OctoberCMS – a Laravel-based CMS
Nov 19, 2014 @ 09:22:00

On the SitePoint PHP blog there's a recent post taking a closer look at the OctoberCMS, a content management system based on the Laravel framework. In this new post they walk you through what the CMS is, the features it has to offer and help you understand (and add to) the different kinds of elements.

October CMS is a lightweight, back to basics content management system built on Laravel, and on a mission to make your web development workflow easy again. It boasts a very simple and fast learning curve, with a guarantee that you’ll be off the ground and up and running in no time at all. It’s scalable and extensible through the plugin system, is easily maintainable through its file-based system, and allows for the effortless creation of administrative back-end interfaces. Before we dig a bit deeper into this promising CMS, let’s look at the foundation a bit.

They walk you through the install (from their GitHub repository) to get a sample site up and running. The tutorial then goes through each of the basic sections, explaining what they are and providing example code where appropriate:

  • Themes & Templates
  • Pages
  • Partials
  • Layouts
  • Content Blocks
  • the AJAX Module

They also talk about extensibility via plugins and components and link to more information for those looking for more detail.

tagged: octobercms laravel introduction cms content management system

Link: http://www.sitepoint.com/introducing-octobercms-laravel-based-cms/

Cal Evans:
"Delivery Initiated" A word on having empathy for the users of your software
Oct 08, 2014 @ 09:24:37

In his latest post Cal Evans reminds us, as software developers, that our jobs aren't always about making the things we create about the best code or most tech. It's also about having empathy for users of the software you're building.

I learned something very important in all of [the troubles I had with traveling to Amsterdam], I learned that we as software developers and designers need to have a great deal of empathy for the people using what we build. It is not enough to put yourself in your user’s shoes, you have to put yourself in their mindset. You have to design every user interaction with an understanding of not only who is using your software, but why they are using it.

He focuses the rest of the post on his experience post-delay, trying to get an update on where in the world his luggage might be via a URL given to him by the lost luggage group. He comments on the terseness of the message he was given on the page ("Delivery Initiated") but points out that it's not overly user-friendly and really doesn't give much information. He suggests that the developers of the tool didn't actually think about end users, just that they should share a status and that's all.

It is not enough to create personas and figure out who is using your software. You need to understand why they are using it, and what their mindset will be when they are using it. You need to have empathy for your users.
tagged: user empathy system opinion travel luggage delivery

Link: http://blog.calevans.com/2014/10/07/delivery-initated-a-word-on-having-empathy-for-the-users-of-your-software/

SitePoint PHP Blog:
Introduction to Kirby CMS
Apr 28, 2014 @ 13:48:31

The SitePoint PHP blog has posted a new article introducing you to Kirby, a database-less content management system that's all file based.

Kirby is a lightweight CMS that probably fits somewhere between feature-rich platforms such as Drupal, and static site generators such as Jekyll. What makes Kirby quite different to most CMS’s – and closer to Jekyll in the process – is that it has no database. Instead, everything is stored as files; some for configuration, some for content – all in addition to the usual template files, partials and plugins. In this article I’m going to take a look at Kirby, demonstrate how to use it, and assess some of its strengths and weaknesses.

He walks you through the download and installation process and provides a general overview of the structure of the application and how it works. He gets into the specifics of theming the site to match your own look and feel, shows you how to use "kirbytext", a custom extension of Markdown. He also briefly covers plugins, the main panel and some of the pros and cons of using the system.

tagged: kirby cms content management system file

Link: http://www.sitepoint.com/introduction-kirby-cms/