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

Laravel News:
Building a Laravel Translation Package – Wiring Up The Frontend
Nov 16, 2018 @ 13:33:36

The Laravel News site has posted the latest in their "Building a Laravel Translation Package" series of tutorials with a new post focusing on the frontend and getting it connected to the backend functionality.

In the last installment of this series, we talked through the process of manipulating the translations in our application’s language files into a format where we are now in a position to start interacting with them. In this article, we’ll be wiring up the frontend ready to start building out the user interface which will aid users with the process of translation management.

The UI will be developed using the community favorites, Tailwind CSS and Vue.js.

The tutorial starts with the approach for the functionality, taking a more hybrid approach and using a balance of backend and frontend for the majority of the functionality. It then starts in on the technical parts to connect the two halves:

  • adding the required routes
  • creating the controllers
  • building out the views to render the interface

The majority of the post is then dedicated to the creation of the assets - the Javascript and CSS - to create the "framework" the functionality will use to work with the translations.

tagged: laravel tutorial series translation package backend frontend connect

Link: https://laravel-news.com/laravel-translation-package-frontend

Zend Blog:
Modern cryptography in PHP 7.2 with Sodium
Nov 16, 2018 @ 12:14:24

On the Zend blog there's a new tutorial posted by Enrico Zimuel covering the use of libsodium in PHP 7.2 to provide stronger encryption for your data.

Recently, at ZendCon & OpenEnterprise 2018, I presented a session about the usage of Sodium in PHP 7.2. Here you can find the slides of this session.

Sodium is a powerful library for modern cryptography. It is a portable, cross-compilable, installable and packageable fork of NaCl, a famous cryptographic tool designed by Prof. D.J. Bernstein.

The tutorial begins with an outline of the Sodium encryption including the algorithms it can use and how it helps to prevent side-channel attacks. It then lists out some of the common use cases and provides a simple code sample showing how to use it to encrypt a simple message with a randomly generated key.

tagged: cryptography modern libsodium tutorial introduction

Link: https://blog.zend.com/2018/11/06/modern-cryptography-in-php-7-2-with-sodium/#.W-7xpJNKi-o

Pineco.de:
Adding a Subdomain to Your Laravel Application
Nov 16, 2018 @ 11:44:42

On the Pineco.de blog there's a tutorial for the Laravel users out there showing how to set up subdomains in your application using the built-in framework functionality (and their setup with Valet/Forge).

Often we need to handle subdomains with our Laravel application. Let’s take a look, how can we treat the routes dynamically and set up the subdomain with Valet and Forge.

The tutorial then walks you through the steps to get subdomains working:

  • Defining Subdomains in Our Routes
  • Dynamically Generate Subdomains
  • Faking Subdomains in Valet
  • Setting Up Subdomains in Forge

Each section comes with a brief explanation and any code or configuration changes that would need to be made to make it all work.

tagged: subdomain laravel tutorial route dynamic valet forge

Link: https://pineco.de/adding-a-subdomain-to-your-laravel-application/

CloudWays Blog:
PHP-FPM Cuts Web App Loading Times by 300%
Nov 16, 2018 @ 10:18:33

There's several ways to run PHP on various webservers out there and in a tutorial from the CloudWays blog they focus on one: using PHP-FPM and the performance gain it can give.

Speed matters. Our engineers are always looking at ways on improving the stack. One of the major objectives of our stack integrations is to improve the speed of the overall processes of our stack.

Keeping up with this practice, in a bid to increase speed of aspects of Managed Cloud Hosting coupled with constant improvements based on users feedback, Cloudways has now integrated PHP-FPM in all its servers. Owing to this integration, applications hosted on Cloudways servers are now going to perform up to 3x faster.

The post starts with a look at why to choose PHP-FPM and shares some benchmarks of it in use versus the more typical mod_php shared module. It then gets into the implementation steps, linking to a step-by-step guide on how to implement it.

tagged: phpfpm performance tutorial installation benchmark

Link: https://www.cloudways.com/blog/php-fpm-on-cloud/


Sameer Nyaupane:
PHP Test Driven Development Part 5: Integration Testing
Nov 15, 2018 @ 13:54:21

Sameer Nyaupane has posted the latest part in his "PHP Test Driven Development" series of tutorials. In this latest post, part five, he focuses on integration testing, ensuring the components are all working together as they should.

Let’s learn about Integration testing today. Integration testing is a method of testing by passing in the real dependencies and thus testing out the integration between two or more objects.

He updates the examples from his previous post to test the integration between the Math and Calculate classes. He walks you through the changes required to the phpunit.xml configuration and the creation of the initial test classes. He goes through each line of the tests, explaining what it's doing and how mocks are used to help with dependencies.

tagged: tutorial testdrivendevelopment tdd part5 series integration testing

Link: https://medium.com/@sameernyaupane/php-test-driven-development-part-5-integration-testing-51535ca56bf0

PHPUgly Podcast:
Episode #128 - The Set Up
Nov 15, 2018 @ 11:19:32

The PHPUgly podcast, hosted by PHP community members Eric Van Johnson, John Congdon and Thomas Rideout, has posted their latest episode - Episode #128: The Set Up.

In this latest show, the hosts discuss several topics including the preloading RFC, Laravel Telescope and the post from Freek Van der Herten about other people's setups.

You can listen to this latest show either using the in-page audio player or by downloading the mp3 directly for listening at your leisure. If you enjoy the show, be sure to subscribe to their feed and follow them on Twitter to get updates when the latest shows are released. You can also support them via Patreon to help make the show even better!

tagged: phpugly podcast ep128 setup community

Link: http://www.phpugly.com/128

TutsPlus.com:
Write to Files and Read Files With PHP
Nov 15, 2018 @ 10:41:04

TutsPlus.com has continued their series of posts covering some of the basics of the PHP language with their latest article. In this newest tutorial they cover reading from and writing to files using functionality already included with the language.

In this tutorial, you'll learn several important functions in PHP which are sufficient for all your basic file reading and writing needs. You'll learn how to read a file, write to a file, write to a text file, and check if a file exists.

Luckily, PHP provides a lot of functions to read and write data to files. In this tutorial, I'll show you the easiest ways to read data from a local or remote file and how to use flags to write to files exactly how we want.

The tutorial is broken down into several sections:

  • checking if a file exists
  • reading data from a file
  • writing data to a file
  • reading and writing data to files

Each section comes with a bit of description and code examples showing it in action. The post wraps up with some final thoughts and "gotchas" that you need to know when working with files in PHP (especially large ones).

tagged: tutorial introduction file read write beginner

Link: https://code.tutsplus.com/tutorials/reading-and-writing-data-to-files-in-php--cms-32117

Larry Garfield:
Book review - Functional Programming in PHP
Nov 15, 2018 @ 09:28:47

Larry Garfield has posted a book review to his Steemit site giving his thoughts about the "Functional Programming in PHP" book from php[architect] press.

I was asked by php[architect] a while back to review "Functional Programming in PHP, 2nd Ed" by Simon Holywell. I've been sitting on this review for a while, so it's time to finally get it done.

He starts with some of the usual disclosures about receiving the book (for free), what the review is based on and that the opinions are his alone. He goes on to share some of his initial impressions of the book and whether he feels it's a good book to recommend to those wanting to start out with functional programming in PHP. He also points out that, while the book was published in 2016 the recommended PHP version even then was quite old (v5.4). He covers some of the topics that the book covers, noting that many of them, while interesting, don't add much to the overall book.

He does focus on one chapter and how, at the beginning, it showed promise but quickly moved towards using 3rd party libraries for more complex operations. He finishes the review by answering the question: "does this book make me care about functional programming in PHP?"

tagged: bookreview functional programming tutorial phparchitect

Link: https://steemit.com/php/@crell/book-review-functional-programming-in-php