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

Tomas Votruba:
How to Manage Configuration in Symfony without Bundle, Extension, and Configuration?
Nov 30, 2018 @ 18:55:07

In this new post to his site Tomas Votruba shows how to configure a Symfony application without using the bundle or extension configurations.

Symfony Flex is moving towards of bundle-less applications. That doesn't mean you should create a monolith code in /src as fast as possible, but rather control everything via .yaml and .env files. It's takes few steps to remove extension and move to import of services.yaml.

But how would you approach a simple task as setup a account number parameter?

For those not familiar with "no-bundle applications" in Symfony, he starts with a link to the SymfonyCast course listing out the main points. Following this he covers what changes in the service registration and what changes in the configuration (with code examples). He then provides some options including keeping the extension, setting the parameter manually and binding the parameter, favoring the last two on his list as more maintainable.

tagged: tutorial symfony configuration bundle extension management

Link: https://www.tomasvotruba.cz/blog/2018/11/29/how-to-manage-configuration-in-symfony-without-bundle-extension-and-configuraiton/

Laravel News:
Building a Laravel Translation Package – Wrangling Translations
Nov 05, 2018 @ 17:53:20

On the Laravel News site they've continued their "Building a Laravel Translation Package" series of tutorials with the latest article covering the "wrangling" of the translations themselves.

As we’ve discussed earlier in the series, out of the box, Laravel translations are stored in language files. These can be either PHP array-style syntax or straight up JSON files.

[...] The plan for the package is, much like many features of Laravel, to expose multiple drivers to power the translation management. The first driver will utilize Laravel’s existing file-based translations with plans to later add a database driver.

[...] The file driver needs to interrogate the filesystem in order to return the data in the required format. This involves a lot of filtering, mapping and iterating, so we will lean quite heavily on Laravel’s collections.

The tutorial is then divided up into a few different parts, each for a chunk of the package functionality around translation management:

  • listing languages
  • adding languages
  • listing translations
  • adding/updating translations

Each item in the list comes with a summary of the feature and a few lines of code showing how to implement it.

tagged: translations laravel package series management tutorial

Link: https://laravel-news.com/wrangling-translations

Sergey Zhuk:
Managing Concurrency: From Promises to Coroutines
Oct 31, 2018 @ 19:56:57

Sergey Zhuk has a post to his site covering concurrency including some of the basic concepts and how promises and coroutines come in to play.

What does concurrency mean? To put it simply, concurrency means the execution of multiple tasks over a period of time. PHP runs in a single thread, which means that at any given moment there is only one bit of PHP code that can be running. That may seem like a limitation, but it brings us a lot of freedom. We don’t have to deal with all this complexity that comes with parallel programming and threaded environment. But at the same time, we have a different set of problems. We have to deal with concurrency. We have to manage and to coordinate it.

He goes on to talk about parallel requests, cross-request needs and the requirement for coordination. He then covers the subject of promises, briefly defining it and giving an example of creating a basic promise in ReactPHP. Following this he talks about the other main topic of the article: using PHP generators along with parallel requests to only create the responses when yielded.

tagged: reactphp promise coroutine concurrency management

Link: https://sergeyzhuk.me/2018/10/26/from-promise-to-coroutines/

php[architect]:
August 2018 Issue Release - Masterful Code Management
Aug 06, 2018 @ 16:51:15

php[architect] magazine has posted the announcement of the release of their August 2018 issue: Masterful Code Management.

This issue includes articles like:

  • "Debugging PHP With Xdebug" by Mark Niebergall
  • "Pro Parsing Techniques with PHP, Part Three: Using Regular Expressions" by Michael Schrenk
  • "MySQL Generated Columns, Views, and Triggers" by Dave Stokes

All of the usual columns are back too including tips for using PhpStorm, using gitflow, secure token management and PHP community. You can pick up a copy to call our own from the php[architect] site and, if you're curious about the contents and want to "try before you buy", they've posted a free PDF of the "Using Regular Expressions" article to give you a taste.

tagged: phparchitect magazine release august2018 masterful code management

Link: https://www.phparch.com/magazine/2018-2/august/

Pineco.de:
Easy Role Management with Pivot Models
Feb 13, 2018 @ 16:41:32

On the Pinco.de blog there's a post that covers the use of pivot models for role management in SaaS applications. The tutorial shows how to use the Laravel Eloquent "withPivot" method and a pivot database table to create an easy to use relationship between "users" and "teams" in a PHP application.

If you have ever developed any kind of SaaS app (like Spark), you know what team level role management means. Instead of picking a bad strategy for handling roles, we can bring simple solution by using Pivot Models.

The tutorial starts by talking about "robust permission handling" and why, more often than not, a simpler role-based approach is enough. It then covers the pivot table itself, showing the code to create the table. Next comes the creation of the relationship between teams and users via the withPivot method. With the relationship in place, the article then covers attaching users to a team, generating the models and how to add permission evaluation into the model's functionality.

tagged: role management pivot model tutorial laravel eloquent

Link: https://pineco.de/easy-role-management-pivot-models/

That Podcast:
Episode 44: The One Where We Manage Products
Jan 26, 2018 @ 15:52:22

That Podcast, hosted by PHP community members Beau Simensen and Dave Marshall, has posted it's latest episode - Episode #44: The One Where We Manage Products. They're joined by special guest Christophe Dujarric.

Christophe Dujarric shares his experience with Product Management

Other topics mentioned include a tweet about Bitcoin refunds, sketch collaboration tools, Laravel Shift and the article "Product Design is not Product Management". You can listen to this latest episode either using the in-page audio player or by downloading the mp3 directly. Be sure to subscribe to their feed and follow them on Twitter to get updates when the latest shows are released.

tagged: thatpodcast e44 podcast beausimensen davemarshall product management

Link: https://thatpodcast.io/episodes/episode-44-the-one-where-we-manage-products

TutsPlus.com:
Package Management in Laravel
Oct 24, 2017 @ 14:34:28

On the TutsPlus.com site there's a new tutorial posted sharing some helpful tips on how to manage packages in a Laravel application making use of Composer's functionality.

In this article, we'll go ahead and explore the package management feature in the Laravel framework. In the course of the article, we’ll go through a real-world example to demonstrate the purpose of the article.

Package management in Laravel is an important feature that allows you to bundle a piece of functionality so that it can be distributed easily. Moreover, you could always publish your package to repositories like Packagist and GitHub that allow other developers to benefit from your package.

They start by listing out the files that will be involved in the tutorial (requiring a pre-set up Laravel application) and a basic knowledge of the application's structure. The article then walks through setting up some of the prerequisites and the creation of your own custom package. They include the updates to the routing, controller, updates to the view and changes in the service provider handling.

tagged: laravel package management tutorial introduction composer

Link: https://code.tutsplus.com/tutorials/package-management-in-laravel--cms-29625

SitePoint PHP Blog:
Let’s Compare: RunCloud vs Forge vs ServerPilot
Sep 26, 2017 @ 17:27:01

On the SitePoint PHP blog there's a new post that compares three deployment tools to help you manage your VPS servers: RunCloud vs Forge vs ServerPilot.

When your website or web application has outgrown your shared hosting account, it is time to move it to the cloud, or into a virtual private server (VPS). [...] However, I can recall when I wanted to move my website to Amazon Web Services a few years ago, and it took me days to deploy the server and get it ready with PHP, MySQL and Apache.

Fortunately, that is not the case today as we have the help of some cool tools and third party services. I took a look at three similar services – RunCloud, ServerPilot and Laravel Forge – and compared them to see which performs best.

The post then walks through each service showing how to set up an account and talking about the pros and cons. Screenshots are included showing the UI and the steps you'll need to set up servers and providers. The post ends with a look at performance tests on the resulting VPSes including information like time of request completion, response time and successful/failed transactions. These results show a clear leader as far as performance results - Laravel Forge - but there are some reminders that performance is only part of what you should consider when selecting a service.

tagged: service comparison vps management runcloud forge serverpilot

Link: https://www.sitepoint.com/lets-compare-runcloud-vs-forge-vs-serverpilot/

Laravel News:
Introducing Laravel Horizon
Jul 26, 2017 @ 14:42:19

On the Laravel News site today they have a post announcing a new member of the Laravel family that was announced at the current Laracon conference: Laravel Horizon.

The moment everyone in the Laravel community has been waiting for has finally arrived! Laravel Horizon is software to “supercharge your queues with a beautiful dashboard and code-driven configuration.”

[...] Laravel Horizon is designed to make it easy monitor your queues from a web interface and receive notifications when things go wrong.

They list out some of the key features including auto-balancing, code-driven configuration, queue monitoring and a notification system. They briefly describe each of these features and what they see as the "most awesome part" - that the entire thing is open source and 100% free.

tagged: laravel horizon queue management interface release announcement

Link: https://laravel-news.com/introducing-laravel-horizon

QCode.in:
Easy roles and permissions in Laravel 5.4
May 03, 2017 @ 17:06:41

On the QCode.in site Saqueib Ansari has written up a tutorial showing how to use a package in Laravel applications to manage roles and permissions easily. This package, spatie/laravel-permission, compliments the current Laravel roles/permissions handling with a few handy features that make management and evaluation simpler.

Although laravel comes with Policies to handle the authorization but I wanted to have an option to just create permissions in the database which we can manage by a UI in the admin panel, pretty standard. we can implement our own role and permission from scratch but I am going to use [spatie/laravel-permission](https://github.com/spatie/laravel-permission) package for this. This package was inspired by Jeffrey ways screencast and it’s very well maintained and very easy to use. It has everything we need and plays very well with Laravel Gate and Policies implementations.

He walks through the creation of a new Laravel application, running the auth:make to generate the authentication functionality and adding the spatie/laravel-permission package to the service provider. He creates several models for permissions and roles and updates the User model with a new trait. Once the migrations are run, he creates a default permission set. Then it's on to the code for the endpoints to work with roles (including syncing them with permissions). He then moves over to the views, showing how to use the can helper to determine if a user has access, creating an Authorizable trait and an AuthorizationException handler. Finally the tutorial wraps up with the roles and permissions management functionality complete with code and screenshots of the result.

tagged: laravel roles permissions tutorial package laravelpermission spatie management

Link: http://www.qcode.in/easy-roles-and-permissions-in-laravel-5-4


Trending Topics: