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

Fabien Potencier:
The Symfony Trademark
Mar 15, 2017 @ 09:49:58

In a post to his own site Fabien Potencier attempts to clear up any confusion around the use of the Symfony trademark and how SensioLabs manages that trademark.

This blog post has been written after some concerns expressed on Twitter and Reddit about how SensioLabs manages the Symfony trademark. If you want to read the details about the Grafikart issue, scroll to the end [of the post]; reading the whole post is recommended though if you want to understand the whole story.

Fabien starts at the very beginning, talking about how he selected the name for the framework and how it evolved over the years. It was a few years in when he decided to register the trademark officially and the legal battle that came with it. He also talks about the trademark policies they worked up and other projects that have a similar setup. He then gets into some more specific examples where there could be conflicts with these rules.

Enforcing the trademark is a painful process and it costs a lot of money. But I'm convinced that doing so is my responsibility. Would it be fair to say no to people who follow the rules by asking for permission and let other companies do whatever they want? Not in my book.

The rest of the post is dedicated to one particular issue (involving Grafikart) and the issues that came up because of mishandling on the legal side and the changes being made to prevent the confusion in the future.

tagged: symfony trademark sensiolabs framework grafikart

Link: http://fabien.potencier.org/the-symfony-trademark.html

Cloudways Blog:
User Authentication In Yii2 With Email Verification
Mar 13, 2017 @ 13:54:47

The Cloudways blog has a new tutorial posted showing you how to set up a system for user authentication via email in a Yii2-based application. The concepts would be the same in just about any other framework, it's just the code to implement it would be slightly different.

User authentication is an essential component of every web app. Whether it is a simple to-do list or a complex corporate portal, user authentication remains a common factor across all types of PHP applications.

[...] In this tutorial, I will show you how to develop a user authentication component in Yii2 that features a SMTP email verification. If you are new to Yii2, you must first read previous tutorials to get an introduction to Yii2. Next read about form handling in Yii 2 and database management in Yii 2.

The tutorial makes use of this extension for the traditional user handling as a more flexible option than the built-in framework features. They then walk you through the process of creating the new Yii2 project and getting the component installed. It also helps you:

  • run the migrations to create the required tables
  • set up the SMTP mailer
  • update the navigation with the links for logged in/logged out users
  • configuring the email settings

The end result is a signup form that, when submitted will send an email to the user's email address to verify it and allow the user to continue the registration process.

tagged: user authentication yii2 framework tutorial signup package

Link: https://www.cloudways.com/blog/user-authentication-yii2/

TutsPlus.com:
How to Program With Yii2: ActiveRecord
Mar 09, 2017 @ 12:07:53

In the latest tutorial in their "Programming with Yii2" series the TutsPlus.com site shows you how to work with the ActiveRecord functionality included with the framework.

In this Programming With Yii2 series, I'm guiding readers in use of the Yii2 Framework for PHP. In today's tutorial, I'll walk you through using Yii's object-relational mapping, known as ORM, for working with databases. It's called Active Record and is a key aspect of programming database applications efficiently in Yii.

Yii offers different ways to work with your database programmatically, such as direct queries and a query builder, but using Active Record offers a complete set of benefits for object-oriented database programming.

The article goes on from there and defines some of the basics around what Active Record is and how it works. It then starts on the code, showing how to create an ActiveRecord model and execute queries to:

  • locate single or multiple records
  • build queries
  • counting records
  • and accessing the records returned

They also talk about mass assignment, saving data via model instances, deleting records and creating relationships between the models.

tagged: yii2 framework series activerecord database tutorial introduction

Link: https://code.tutsplus.com/tutorials/how-to-program-with-yii2-active-record--cms-27434

SitePoint PHP Blog:
The State of PHP MVC Frameworks in 2017
Mar 03, 2017 @ 09:49:40

The SitePoint PHP blog has a new post sharing the current state of PHP MVC frameworks in 2017. The article doesn't focus on any particular list of frameworks (though the more popular ones are used in the examples) and instead focus on the overall trends they've seen in frameworks and their use.

A simple question prompted me to sit down and write this follow up to my article from about a year ago: "Any thoughts about where things are today?"

He suggests that, while several of the major frameworks are still in active development and are seeing new features in recent versions, the front-runners are probably Laravel and Symfony. He includes trend numbers to back this up (popularity, basically) but also briefly touches on others: CakePHP, CodeIgniter and Zend Framework 2. He then breaks it down into two groups: Symfony/Laravel and "the rest". The post wraps up with a look at the rise of microservices, the "destruction of the monolith" and a more recent emphasis on scalability over just features.

tagged: state mvc framework 2017 opinion laravel symfony trend popularity

Link: https://www.sitepoint.com/the-state-of-php-mvc-frameworks-in-2017/

Toptal.com:
PHP Frameworks: Choosing Between Symfony and Laravel
Mar 02, 2017 @ 11:26:17

On the TopTal.com blog Karin Sakhibgareev shares some of his thoughts around picking the right framework for your project. More specifically he focuses on the selection between two popular options: Symfony or Laravel.

Today, when starting a new project, one of the key decisions is to pick the right framework. It’s become hard to imagine building a complex web application from scratch nowadays without one.

Many popular languages for web development have their “default” framework, such as Ruby on Rails for Ruby, or Django for Python. However, PHP has no such single default and has multiple popular options to choose from.

[...] In this article, I am going to compare these two frameworks and show you how to implement simple, everyday features with each. This way, you can compare the code of real-life examples side by side.

He starts with a brief history of each project (Symfony and Laravel) and quick guides to getting them installed. He then configures them with a few basic options (database connection, security details, etc) and compares the setup processes against each other. The reminder of the post follows the same pattern covering:

  • routing setup and configuration
  • templating (Blade vs Twig)
  • dependency injection
  • database usage via ORMs
  • event dispatching/middleware

The post ends with a sort of "real world" application of each framework, showing what it would take to create a simple REST API. He finishes with his thoughts about the "winner" of the comparison...but suggests that it's more about the right tool for the right job than one framework that does it all.

tagged: toptal framework symfony laravel tutorial comparison

Link: https://www.toptal.com/php/choosing-between-symfony-and-laravel-frameworks

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/

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

Matt Stauffer:
Introducing Laravel Dusk (new in Laravel 5.4)
Feb 06, 2017 @ 09:46:06

Kicking off his series of posts looking at the new features that come along with the v5.4 release of the Laravel Framework Matt Stauffer has posted a look at Dusk, a tool that makes it simpler to test your Laravel based applications.

If you follow anyone in the Laravel world on Twitter, or if you listen to the Laravel Podcast, you know by now that Laravel Dusk is the new face of application testing in the Laravel world.

[...] With Dusk, Taylor has completely re-written how application testing works in Laravel. Everything is now based on a tool called ChromeDriver, which is a standalone server that actually controls Chrome/Chromium. When you write application tests, Dusk sends your commands to ChromeDriver, which then spins up Chrome to run your tests in the browser and then reports back the results.

He starts with a brief look at how testing was being performed in most cases on Laravel applications (using the "Integrated" package) but pointed out that that only really worked for non-Javascript driven sites. With the introduction of Dusk and it's use of the ChromeDriver to make "browsing" in the test simpler. He includes the installation process of the latest version of Dusk and an example test checking to be sure the string "Laravel" is in a page. He includes a gif of the test in action and talks about some of the new interactions and assertions included in the tool. He wraps up the post looking at the use of Pages and a few other miscellaneous tips to help you get your testing up and working productively.

tagged: laravel framework testing dusk introduction tutorial interactions pages

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

Dac Chartrand:
Building a Simple API using Opulence PHP
Jan 30, 2017 @ 11:27:35

Dac Chartrand has written up a post to his site showing you how to create a simple REST API with Opulence, a PHP framework that bills itself as a "modern framework for modern PHP".

This tutorial will show you how to code a simple JSON API using Opulence PHP. We will install Opulence’s skeleton project using composer, then create a ‘user’ database entity, and finally we will match CRUD (Create, Read, Update, Delete) to POST, GET, PUT, and DELETE.

The start of the tutorial helps you get a new Opulence project set up and running including updating the configuration for content type handling and the database connection details. With that set up he moves into the code creating the "User" entity and its matching classes. He builds out the controller, selecting a REST controller from the options and builds out all methods needed for the CRUD user operations. The tutorial finishes with a bit of testing information so you can see the framework in action.

tagged: opulence api rest tutorial simple user framework

Link: http://kizu514.com/blog/building-a-simple-api-using-opulence-php/

Laravel News:
Laravel 5.4 Is Now Released
Jan 24, 2017 @ 12:04:54

At the Laravel News site mentions, the latest version of the Laravel framework has been released: Laravel 5.4.

Version 5.4 of Laravel is now officially released! This release has many new features, and improvements.

A video is included in the post showing some of these features and improvements as well as a text-based version with a bit more detail. Topics include:

  • Laravel Dusk
  • Blade components and slots
  • Markdown emails
  • Route improvements
  • Higher order messaging for collections

Each item in the post comes with a brief explanation of the feature and a code snippet showing how it can be used. It also finishes with some of the smaller updates and links to the 4.5 upgrade guide to help you migrate your current application.

tagged: laravel framework release v54 features improvements migration

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