Amazing PHP
9.94K 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
Please, stop talking about Repository pattern with Eloquent
I regularly see articles like "How to use Repository pattern with Eloquent". The usual contents of them: let's create PostRepositoryInterface interface, EloquentPostRepository class, bind them nicely in DI container and use them instead of the standard Eloquent save and find methods.
Kubernetes: deploy Laravel the easy way
Laravel is an excellent framework for developing PHP applications. Whether you need to prototype a new idea, develop an MVP (Minimum Viable Product) or release a full-fledged enterprise system, Laravel facilitates all of the development tasks and workflows.
Migrating Legacy Web Applications to Laravel
There are two possible approaches to migrating your application to Laravel: a flag-day or an in-place/side-by-side migration.
Serverless case study: PrettyCI and Laravel Queues
The idea is that anytime you push a commit to your GitHub repository, PrettyCI will analyze that commit using PHP CodeSniffer or PHP-CS-Fixer. Since PrettyCI integrates in GitHub's checks tab you can see the build result directly in your repository without having to leave your work.
Hand-written service containers
Dependency injection is very important. Dependency injection containers are too. The trouble is with the tools, that let us define services in a meta-language, and rely on conventions to work well. This extra layer requires the "ambient information" Paul speaks about in his tweet, and easily lets us make mistakes that we wouldn't make if we'd just write out the code for instantiating our services.
A Smart Programmer Understands The Problems Worth Fixing
This is the story of Peter. Peter is a programmer that can do anything. He can create software as good as any of his other peers. However, there's a difference between a programmer with experience from a programmer without experience, even though both have the same technical skills.
SOLID Principles every Developer Should Know
Object-Oriented type of programming brought a new design to software development.
This enables developers to combine data with the same purpose/functionality in one class to deal with the sole purpose there, regardless of the entire application.
But, this Object-oriented programming doesn’t prevent confusing or unmaintainable programs.
10 PHP functions you must know
In this post, you will find 10 PHP functions that are really powerful and will enrich your PHP knowledge.
PHP Interview Exercises
A number of exercises to practice whiteboard interview questions in PHP.
10 OOP Design Principles Every Programmer Should Know
The Object-Oriented Design Principlesare the core of OOP programming, but I have seen most of the Java programmers chasing design patterns like Singleton pattern, Decorator pattern, or Observer pattern, and not putting enough attention on learning Object-oriented analysis and design.
The Definitive 2019 Guide to Cryptographic Key Sizes and Algorithm Recommendations
A lot has been written about cryptography key lengths from academics (e.g. Lenstra's equation) and various standard committees (ECRYPT-CSA, Germany's BSI, America's NIST, etc.) over the years.
Despite the abundance of coverage on this material on the Internet, these resources lack the clarity that we look for when drafting recommendations for software developers and system administrators. Additionally, many of them are showing their age and desperately need to be brought up to speed with a modern understanding of real-world cryptography.
Mocks aren’t Stubs
I want to clarify a confusion which has been on my mind lately.
There is a lot of new information when you start testing for the first time and to understand how Mocks and Stubs work is really important for testing.
30 Shared Principles for discussing Software Architectures
Imagine a fly-by architecture review. An architect walks in, looks over, glosses over, seeing though his binoculars. He provides comments that are often too generic or out of context. Comments are often met with deafening silence or winding arguments. They rarely help anybody if ever. Every programmer dreads it; every architect dreads it too.
Global States: Why and How to Avoid Them
Global states. These words induce fear and pain in every developer’s heart who had the unfortunate experience to deal with them.
Did you already fight against applications behaving unexpectedly, without knowing exactly why, like a poor knight would try to kill an Hydra with too many heads to deal with?
Did you end up in the infinite loop of tries and errors, guessing 90% of the time what was happening?
This could be the annoying consequences of globals: hidden variables changing their states in unknown places, depending on things you don’t yet understand.
My PHP Wishlist
Back when I started using PHP properly in the early 5.0 days, it felt like the language was pretty basic. Other languages were making leaps and bounds every year, and as time went on, PHP seemed to have stagnated. The language wasn’t bad, but it wasn’t as good as it could’ve been.
​​10 must known rules for freelance projects β€” For Developers
I have been in the IT industry for more than 10 years now and have done many out-sourced projects from all around the world. Projects exceed their deadlines, clients change their mind during the project, they won’t pay you on time and how they act to you is sometimes really, really annoying! Then you might get into trouble, arguments and worst case dropping lawsuits against each other, taking your time, mind and money.
After years, finally, I have developed some disciplines and ways of doing freelance projects with the minimum effort.
​​How To Create Meaningful Names In Code
As a developer, you spend a lot of your coding time making variables and thinking about proper names. Names are everywhere. You name files, classes, methods, and variables.
As we spend so much time naming things it’s really important to do it well. In this article, I will show you some simple rules you can follow for creating good names. Naming things in your code is an art in itself!
Intro Guide to Dockerfile Best Practices
There are over one million Dockerfiles on GitHub today, but not all Dockerfiles are created equally. Efficiency is critical, and this blog series will cover five areas for Dockerfile best practices to help you write better Dockerfiles: incremental build time, image size, maintainability, security and repeatability. If you’re just beginning with Docker, this first blog post is for you! The next posts in the series will be more advanced.
Stop using DateTime
Working with date & time in PHP can sometimes be annoying, leading to unexpected bugs in the code:
Preloading in PHP 7.4
PHP 7.4 adds preloading support, a feature that could improve the performance of your code significantly.