Amazing PHP
9.32K subscribers
11 photos
84 links
Welcome to the Amazing PHP Channel! Here you can find a lot of interesting articles/news about PHP, frameworks, tools and development.

Support the channel: https://www.paypal.com/donate?hosted_button_id=FAYP5QJH5LVRL
Download Telegram
Generating an Autoloader for a Legacy PHP Codebase
If you’ve inherited a legacy code base, you may find it does not use an autoloader and has an idiosyncratic directory and file hierarchy for its Classes, Interfaces or Traits. Worse yet, it might not use name spaces consistently or at all. So you can’t use a PSR-4—or even PSR-0—autoloader with your code.
HTTPlug, Guzzle & API's
Guzzle has become the de-facto HTTP-client library for PHP. But recently a number of open source projects have been switching to HTTPlug which boasts itself as an HTTP-client abstraction. We chat about the problems HTTPlug aims to solve, the plans for its future and the reasons behind why some library maintainers have chosen to adopt it or not.
Channel name was changed to «Amazing PHP»
Closures, Anonymous Classes and an alternative approach to Test Mocking
I have heard people say that you shouldn’t test abstract classes or traits, only the concrete classes that implement or use them. I don’t follow that approach: unit testing is all about testing in isolation from anything that might affect those tests.
Testing With PhpSpec
PhpSpec is a testing tool based on the concept of emergent design using specification. You may have heard of Behavior Driven Development (BDD), and PhpSpec is a tool to use at the spec level or SpecBDD. We also mentioned PhpSpec in our recent roundup of Laravel Testing Resources, which includes ways you can incorporate PhpSpec into your Laravel workflow if you are interested in trying out SpecBDD.
Symfony Console Beyond the Basics – Helpers and Other Tools
It’s undeniable how useful console commands can be when developing software. Not too long ago we re-introduced the Symfony Console component.
Goodbye controllers, hello request handlers
A lot has changed in the PHP landscape over the past years. We started using more design patterns and things like the DRY and SOLID principles. But why are we still using controllers?
Using JSON Web Token (JWT) as a PHP Session
Developers frequently use PHP Sessions to persist user data between different requests from the same site. PHP Sessions can be used to detect if the user is logged in or to get/set some id to identify current users. It's definitely a useful technique for web development.
UML Diagrams in PhpStorm 2017.2
Unified Modelling Language can be used to draw out the relationships between classes, abstract classes, and interfaces, to help you to visualize exactly how your classes interact and are related. PhpStorm has tools that can help you to create these diagrams, and manipulate your code from within the chart.
10 Common Software Architectural Patterns in a nutshell
Ever wondered how large enterprise scale systems are designed? Before major software development starts, we have to choose a suitable architecture that will provide us with the desired functionality and quality attributes. Hence, we should understand different architectures, before applying them to our design.
Hiding API fields dynamically — Laravel 5.5
I recently saw a question on Laravel Brasil community that turned out to be a lot more interesting than it looks. Imagine you have a UsersResource with the following implementation:
Some humor
Advanced Multi-Model Forms in Yii2
Consider a Product model that has a single Parcel model related, which represents a parcel that belongs to the product. In the form you want to enter information for the product and the parcel at the same time, and each one should validate according to the model rules.
Protecting passwords with Argon2 in PHP 7.2
PHP 7.2 will be released later this year (2017). This version contains some interesting additions, including two new security features: support of the Argon2 password hash algorithm, and the ext/sodium extension wrapping the libsodium library.
Goodbye controllers, hello request handlers
A lot has changed in the PHP landscape over the past years. We started using more design patterns and things like the DRY and SOLID principles. But why are we still using controllers?
​​Elegant background jobs in PHP
For a long time, I was looking for some elegant solutions to create and run background jobs in PHP.
I joined a company which used Laravel massively and Laravel ships with an awesome Queue system. Suddenly, I forgot how tedious and troublesome it used to be for me to write queues in PHP.
​​Symfony Console Beyond the Basics – Helpers and Other Tools
It’s undeniable how useful console commands can be when developing software. Not too long ago we re-introduced the Symfony Console component.
​​Prooph: CQRS+ES in PHP. How to use.
Pattern CQRS and Event Sourcing become more and more popular every day in PHP community. You can easily find lot libraries to store events, to execute commands, to manage repositories, etc. The leader there doesn’t exist yet, but prooph as the most complex solution is close to that position. They have only one problem, documentation.