Best of PHP — November 2024
- 1
- 2
ThePrimeTime·1yPHP 8.4 Is Good
PHP 8.4 introduces significant updates including property hooks, asymmetric visibility, and an enhanced DOM API. It also brings performance improvements, bug fixes, and additional features such as better support for computed properties, new array functions, and improved database driver interfaces. These changes are aimed at bringing modern features and improved usability to the language.
- 3
Laravel News·1y
Solo for Laravel
Solo for Laravel is a package that enhances local development by allowing multiple commands to be run simultaneously, each in its own terminal tab. It leverages Laravel Prompts to create innovative Text-based User Interfaces (TUIs). Installation involves requiring the package with Composer and installing the Solo Service Provider. Solo is customizable and supports both Light and Dark themes.
- 4
DEV·1y
PHP is a Single-Threaded Language, So How Does Laravel Handle Queue Jobs Asynchronously?
PHP is a single-threaded language, but Laravel can handle queue jobs asynchronously using multiple workers. Each worker is a separate long-running PHP process that listens for and processes jobs from a queue backend like Redis or a database. Tools like Supervisor manage these workers in production, ensuring they run continuously. This design allows Laravel to handle tasks in parallel, improving performance and user experience.
- 5
Community Picks·1y
Laravel Playground
Laravel Playground is a web-based tool that allows users to try out PHP and Laravel straight from their browser. It provides access to all Laravel classes and many included Laravel packages. Users can also load their own Gists by appending the Gist ID to the URL. Example Use Cases include multiple views, form request validation, and using Livewire.
- 6
Laravel News·1y
Laravel Solr
Laravel-Solr is a package developed by Haider Jabbar Abdullah to integrate Apache Solr with Laravel applications. It offers easy installation, comprehensive indexing and searching methods, and built-in support for common use cases. After setting it up, developers can create cores, define fields, add documents, and use the query builder for searching. Additional commands are available for updating and deleting cores and fields.
- 7
Community Picks·1y
php/pie: The PHP Installer for Extensions
PIE is a PHP installer for extensions that requires PHP 8.1 or newer but can install extensions for any PHP version. Extension maintainers are encouraged to add PIE support to their extensions. Users must download and validate pie.phar and can invoke PIE with PHP commands. Installation and usage details, supported extensions list, and further documentation are available in the usage docs.
- 8
Exakat·1y
List of PHP native interfaces, and their implementation
This post provides a comprehensive list of PHP native interfaces and their corresponding implementations as native classes, based on PHP 8.3 source code. It includes interfaces like ArrayAccess, Countable, DateTimeInterface, Iterator, JsonSerializable, and more along with their implementing classes. The compilation is derived from a standard PHP 8.3 distribution with a few additional extensions.
- 9
Laravel News·1y
Asymmetric Property Visibility in PHP 8.4
PHP 8.4 introduces asymmetric property visibility, allowing different visibility scopes for reading and writing properties. This means properties can have various access levels for getting and setting. An example demonstrates how public properties can be set to have protected or private set visibility, giving developers more granular control. Note that class properties must have a type and set must be as restrictive or more restrictive than get.
- 10
Laravel News·1y
Transform Data into Type-safe DTOs with this PHP Package
The PHP Data Model package allows for lightweight and non-invasive hydration of type-safe PHP objects using reflection and attributes. It simplifies object hydration, ensures type safety, reduces defensive programming, and allows flexible value resolution. Integrate it seamlessly by adding the DataModel trait to your classes without altering class hierarchies. Additionally, it offers advanced features like required properties enforced via attributes, with extensive documentation and source code available on GitHub.
- 11
Backend Developer·1y
Building a Movie Website: My Journey to Learning Backend with PHP and AJAX
Developing a movie website led to an in-depth exploration of backend development with PHP and AJAX. Key features include dynamic watch pages, real-time like/dislike systems, favorite movie management, collections management for admins, bulk movie additions, multi-language support, a user authentication system, and view tracking. The project successfully bridged the gap between frontend and backend development, with plans to explore Node.js in the future.
- 12
Laravel News·1y
PIE (PHP Installer for Extensions)
PIE (PHP Installer for Extensions) simplifies managing PHP extensions by providing a modern, flexible alternative to PECL. Extensions can be distributed via Packagist and installed using a familiar Composer-like process. The project is in active development with a stable pre-release available. Developers can install extensions with a simple command and extension authors can make their extensions compatible by adding a composer.json file.
- 13
Theo - t3․gg·1yReact is not PHP
The discussion revolves around the evolution from PHP to modern fullstack JavaScript frameworks like React and Next.js. It highlights the differences and advancements made in server components, bridging the gap between backend and frontend developers, and showcasing tools like Convex for seamless backend integration. The post emphasizes the complexity of modern web applications compared to simpler past projects and argues that new tools and frameworks enable more efficient development.
- 14
Community Picks·1y
Building Maintainable PHP Applications: Data Transfer Objects
PHP developers often use arrays for handling data, but they fall short in complex scenarios due to lack of types and visibility. Data Transfer Objects (DTOs) offer a structured alternative, clearly defining data properties and their types, which improves code readability, maintainability, and IntelliSense support. DTOs are particularly useful when handling multiple data values, either from web requests, API responses, or other data sources.
- 15
InfoWorld·1y
PHP updates DOM API
PHP 8.4.1 introduces an updated DOM API with standards-compliant support for parsing HTML5 documents, improved performance, better syntax, and enhanced type safety. New features include the `BcMath\Number` object for arbitrary precision number operations, controls for property scope access, and support for lazy objects.
- 16
Community Picks·1y
The PHP Foundation
The PHP Foundation is a collective of individuals and organizations dedicated to ensuring the long-term prosperity of the PHP language. It provides financial support and guidance to developers, focuses on maintenance and new feature development, and promotes the language's public image. The foundation consists of ten founding members and an Advisory Board, and it is open to new sponsors.
- 17
Community Picks·1y
Set Sail with your Laravel app on DigitalOcean
LaraSail is a CLI tool that simplifies the process of deploying Laravel applications on DigitalOcean servers. It allows you to easily set up servers with various versions of PHP and databases like MySQL and MariaDB, as well as Redis. With commands for creating new projects, managing databases, and configuring Nginx, LaraSail helps streamline Laravel deployments. It supports creating new Laravel projects, adding Laravel Jetstream, and setting up web domains with SSL certificates.
- 18
Community Picks·1y
Php 8.4 Asymmetric Visibility Explained In Detail
PHP 8.4 introduces a unique feature known as Asymmetric Visibility, allowing different read and write access levels for class properties. This feature enhances encapsulation by permitting properties to be read publicly while restricting write access to the class or its subclasses. Traditional visibility levels like Public, Private, and Protected are also discussed. The syntax and crucial rules for implementing Asymmetric Visibility are outlined, emphasizing its exclusive availability in PHP 8.4 and later versions.
- 19
Laravel News·1y
Efficient Large Dataset Handling in Laravel Using streamJson()
When dealing with large datasets in Laravel applications, using the streamJson method enables incremental JSON data streaming, which improves performance and memory efficiency. This method is beneficial for progressively delivering large datasets to the client. The example provided demonstrates how to manage a large inventory dataset efficiently utilizing streamJson alongside eager loading and the cursor() method.
- 20
- 21
Laravel·1y
Vapor: PHP 8.4 Is Now Supported
You can now deploy applications using PHP 8.4 on Vapor. Update the `vapor.yml` configuration file with the new runtime version. Docker runtimes can also use PHP 8.4 by updating the base image. Vapor supports Arm architecture for Docker runtimes. Laravel encourages users to try PHP 8.4 for a robust and developer-friendly experience.
- 22
Laravel News·1y
Dynamic Cache, Database, and Mail Builders in Laravel 11.31
Laravel 11.31 introduces several new features including dynamic cache, database, and mail builders, a cache token repository for password reset tokens, and a URL::forceHttps() method to enforce HTTPs. Additionally, features include backing enums for the onQueue() method, a method to remove deferred services, and appending/prepending middleware priorities. These updates aim to provide more flexibility and control to developers.
- 23
Collections·1yPHPStan 2.0 Released: Enhanced Performance and New Functionalities for PHP Developers
PHPStan 2.0 has been released after three years of development, featuring over 180 updates focused on enhanced performance and new functionalities. Highlights include level 10 strict type handling, introduction of list types, significant memory consumption reduction, streamlined inline PHPDoc validation, and improved caching that uses less disk space. This release is a milestone for PHP developers aiming for higher code quality and productivity.
- 24
FREEK.DEV·1y
Laravel Custom Query Builders Over Scopes
Oh Dear is a comprehensive monitoring tool that checks website uptime, SSL certificates, broken links, and more. It offers a developer-friendly API, detailed documentation, and the ability to create a public status page in under a minute. The author also shares programming tips and tutorials, primarily focused on Laravel, via a monthly newsletter.
- 25
FREEK.DEV·1y
The magic behind Laravel's new defer() helper
Oh Dear is an all-in-one monitoring tool for websites, offering features like uptime monitoring, SSL certificate checks, broken link detection, and scheduled task monitoring, with a user-friendly API and documentation. The post highlights the utility of Laravel’s new defer() helper and provides insight into the author's monthly newsletter, which includes programming tips, tricks, tutorials, and opinions with a focus on Laravel.