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

Symfony Finland:
State of GraphQL PHP libraries and Symfony integrations in 2017
Nov 15, 2017 @ 11:16:39

On the Symfony Finland site, there's a post that looks at the current state of GraphQL PHP libraries in 2017 and how they are integrated with applications using the Symfony framework.

GraphQL has continued to gain momentum over the course of 2017. While it's certainly not a replacement for REST in all cases, it does provide consumers of Content APIs, etc. better ergonomics than general purpose RESTful interfaces. For PHP there are currently two popular libraries, both of which have Symfony integration Bundles.

The post starts by talking about implementing GraphQL functionality in your own application and mentions the two main libraries currently used: Webonyx GraphQL PHP and Youshido GraphQL. It goes on to talk about the integrations both of these provide as bundles and a bit about what each has to offer. The post then wraps up with a look forward to the Symfony Flex support they provide and a few links to other resources about GraphQL and its use in Symfony applications.

tagged: symfony framework graphql library bundle webonyx yushido

Link: https://symfony.fi/entry/state-of-graphql-php-libraries-and-symfony-integrations-in-2017

TutsPlus.com:
How to Create a Custom Authentication Guard in Laravel
Nov 10, 2017 @ 11:53:25

In the TutsPlus.com site there's a tutorial posted showing you how to create a custom guard in Laravel by building on top of the current system to integrate it with a MongoDB database.

In this article, we’re going to cover the authentication system in the Laravel framework. The main aim of this article is to create a custom authentication guard by extending the core authentication system.

Laravel provides a very solid authentication system in the core that makes the implementation of basic authentication a breeze. [...] Moreover, the system itself is designed in such a way that you could extend it and plug in your custom authentication adapters as well. That’s what we'll discuss in detail throughout this article.

The article then starts out with a brief description of the two parts of the system: "guards" and "providers". It then provides the list of files that will be involved and where they belong in the overall structure. From there it's on to the configuration changes and code required to make the link to the MongoDB database and the creation of the User model and authentication provider. Next comes the code to create the guard and what's required to tie it all together and make the full system work. The tutorial wraps up with an example of testing this new guard via a simple controller call.

tagged: laravel tutorial guard authentication user framework mongodb

Link: https://code.tutsplus.com/tutorials/how-to-create-a-custom-authentication-guard-in-laravel--cms-29667

Joshua Thijssen:
Symfony's autowiring
Nov 02, 2017 @ 10:26:18

Joshua Thijssen has a new post to his site looking "under the hood" at Symfony's autowiring functionality used to locate and initialize services for the framework as needed.

When asking people if they use Symfony’s autowiring functionality, an often heard excuse why people don’t use it is because of all the magic that is happening during autowiring. But just like most impressive magic tricks, once explained, it all boils down to a few simple principles and Symfony’s autowiring is nothing different in that perspective. In this blogpost I will explain the new autowiring and autoconfiguration features, and why you should love them.

He starts off with an example of how to define services manually. He then explains how these services are used in the code and how to pass in arguments when fetching. He then moves on to the automatic generation of the services (the autowiring) and how the framework is "tricked" into using the namespace of the discovered service as the name. This is also used in dependency handling. The post then covers when the autowiring won't work, autoconfiguration and how to set defaults on service definitions (for arguments).

tagged: symfony autowiring tutorial indepth configuration framework

Link: https://adayinthelifeof.nl/2017/09/19/symfony-autowire.html

Symfony Blog:
Symfony 3.4 and 4.0 are about to enter into their "feature freeze" period
Sep 28, 2017 @ 11:28:42

On the Symfony blog there's a new post talking about the upcoming feature freeze for Symfony 3.4 and 4.0.

Symfony project follows a time-based development process where two new minor versions are released each year and a major version is released every two years.

This year, Symfony 3.4 and Symfony 4.0 will be both released at the end of November 2017. The only difference between both versions is that 3.4 includes all features deprecated in 3.x branches and 4.0 removes them.

Two months before their final releases, Symfony versions enter into a "feature freeze" period. During this time, we can't add new features and we solely focus on polishing and stabilizing the new features (and even reverting them if they don't work properly).

In other words, this week is our last chance to add new features to Symfony 3.4 and 4.0.

The post lists out a few ways that you can help out including reviewing pull requests and issues to see if there's anything that might be missing from these releases and might need to be integrated pre-freeze.

tagged: symfony framework featurefreeze v34 v40 project

Link: http://symfony.com/blog/symfony-3-4-and-4-0-are-about-to-enter-into-their-feature-freeze-period

Laravel News:
Laravel 5.6 Will Remove the Artisan Optimize Command
Sep 22, 2017 @ 10:23:13

As this post to Laravel News mentions the upcoming v5.6 release of the framework will remove the artisan optimize functionality from the project's artisan command line tool.

The Artisan optimize command is deprecated as of 5.5, and a commit in master has already removed it from 5.6. Waiting until 5.6 gives you time to update your build scripts and composer.json files ahead of the release.

As of Laravel 5.5, the composer.json no longer references optimize in the post-install-cmd and post-update-cmd scripts. The Optimize command is still defined, but does nothing in 5.5.

The project has provided some reasoning behind the change, mostly having to do with the overall performance improvements in the PHP language itself. Additionally, there was some discussion around the removal before it was finalized.

tagged: laravel optimize command removed v56 framework commandline artisan

Link: https://laravel-news.com/laravel-5-6-removes-artisan-optimize

Auth0 Blog:
Building an app with Nette and adding authentication
Sep 21, 2017 @ 10:07:59

On the Auth0 blog there's a tutorial posted that shows you how to build an application with the Nette framework and easily integrate authentication via their own JSON web token functionality.

Nette is a free, open-source PHP framework designed for building web applications. Nette is a set of decoupled and reusable PHP packages that will make your work easier. And Nette is also known as the quick and comfortable web development framework in PHP because it has the tools that allow you to bang out PHP applications rather quickly.

[...] In this tutorial, I'll show you how easy it is to build a web application with Nette and add authentication to it. Check out the repo to get the code.

The tutorial starts by talking about some of the built-in tools the framework includes and some basic use of each. It then gets into building the application, creating the controller, view and template to output a list of characters from Game of Thrones. From there it moves into the authentication piece, showing the integration of the Auth0 plugin and how to hook it into an application on their platform. There's a bit of configuration to set it up as an authenticator but then the framework and the plugin take care of the rest.

tagged: nette framework authentication tutorial auth0 jsonwebtoken json jwt

Link: https://auth0.com/blog/building-an-app-with-Nette-and-adding-authentication/

Laravel News:
Laravel 5.5 Now Includes TrustedProxy
Sep 15, 2017 @ 11:07:03

On the Laravel News site there's a new post about a feature introduced in version 5.5 of the popular PHP framework: a proxy that's included by default as a part of the TrustedProxy feature.

Laravel v5.5 was released just a week ago at Laracon EU. You may have noticed that the v5.5 composer.json file requires the similar functionality Symfony has).

tagged: laravel proxy package feature cloudflare tutorial framework

Link: https://laravel-news.com/trusted-proxy

Symfony Blog:
The Symfony Unicorn: 1 Billion Downloads
Sep 12, 2017 @ 12:55:32

On the Symfony blog they talk about a major milestone the framework has reached: one billion downloads of the components that make up the Symfony framework.

A Symfony unicorn!!? It's real! On September 5th, the Symfony Components crossed a huge landmark: the 1 billionth download! This happened less than one year after the last milestone: 500 million downloads. That's right: the PHP community downloaded the Symfony components more than 500 million times in just one year. That's well over 1 million downloads every day!

There are so many people that have made this possible, and we would like to thank all of you who have supported Symfony: developers, contributors, companies, evangelists and - of course - users! There are now over 80 Symfony packages and 1,500 people have contributed code to these. None of this is possible without your help. Congrats!

The post then talks about the current state of the components (including their download numbers), their backwards compatibility promise and how it relates to the upcoming Symfony 4 release.

tagged: symfony component billion download achievement framework

Link: http://symfony.com/blog/the-symfony-unicorn-1-billion-downloads

Laravel News:
BotMan 2.0 PHP Chatbot Framework
Sep 01, 2017 @ 09:20:20

On the Laravel News site today there's a new post covering the release of BotMan v2.0, one of the more popular chatbot libraries for PHP.

BotMan is a framework agnostic PHP Chatbot framework designed to simplify the task of developing innovative bots for multiple messaging platforms, including Slack, Telegram, Microsoft Bot Framework, Nexmo, HipChat, Facebook Messenger, WeChat and many more.

BotMan 2.0 was released earlier this week with a bunch of improvements and exciting changes.

As a part of this new release, functionality was abstracted out into separate repositories making it easier to maintain those features without having to change core code. They then include an example of using the the library to create a simple chatbot that replies to a simple "hello" message. They also cover some of the more advanced features including middleware handling and natural language processing support. There's also a tool, BotMan Studio, that's included with the package to help make testing your chatbot script easier. The post wraps up with an example of using this to test the chatbot and a list of some of the other new features in v2.0.

tagged: botman chatbot framework release v2 overview example

Link: https://laravel-news.com/botman-php-chatbot

Omniceps.com:
Introduction to Latte | Best PHP templating engine
Aug 17, 2017 @ 11:30:15

On the Omniceps site there's a new post introducing you to Latte, the templating component of the Nette framework that can be used independently.

A PHP templating engine is the one which gives you ability to write html for your clients efficiently using PHP variables.

However, PHP was originally built to be a templating engine, but yet it was never used primarily as a templating engine. There has been so many PHP templating engine so far in the market since PHP evolved, but none of them has made as great impression on us as Latte. Introducing you to Latte, one of the best PHP templating engine you have come across so far. Also Latte protects your web app from vulnerabilities like XSS (cross site scripting).

The tutorial starts with an example comparing "plain old PHP" templating with the Latte version for a foreach loop. Next they show how to install the Latte component and the two different kinds of macros the tool includes. They also talk about filters, performance concerns, context aware escaping and "pretty output" options.

tagged: nette framework template component latte introduction tutorial

Link: http://www.omniceps.com/latte-best-php-templating-engine/