Best of PHPDecember 2024

  1. 1
    Article
    Avatar of lnLaravel News·1y

    Laravel VS Code Extension Public Beta

    The Laravel core team has announced the public beta release of the official Laravel VS Code extension during Laracon US 2024. The extension aims to improve the development workflow by offering enhanced autocomplete, click-to-source navigation, and various helpful tools. Key features include auto-completion for routes, models, views, and more, direct links to definitions, and warnings for missing configurations or templates. Additional upcoming features include integration with VS Code test runner, Livewire, Volt, and Pint support.

  2. 2
    Article
    Avatar of webcraftWebCraft·1y

    NativePHP Desktop App Builds are Here

    NativePHP allows developers to build desktop applications using PHP. It can be integrated with Laravel, providing a robust solution for creating native desktop apps with familiar tools.

  3. 3
    Article
    Avatar of communityCommunity Picks·1y

    Why PHP 8 Has High Performance

    PHP 8 significantly improves performance with the introduction of the JIT compiler, optimized function calls and array operations, new data structures such as the Red-Black Tree, and fixes to internal implementation details. These enhancements lead to better execution speed and memory management, making web application development more efficient.

  4. 4
    Article
    Avatar of devgeniusDev Genius·1y

    How Autoload made PHP elegant

    The autoloading mechanism has significantly streamlined PHP development by dynamically loading files as needed, thereby reducing clutter and enhancing efficiency. Before PHP 5.3, developers had to manually include files using require and include, leading to disorganized code and class name conflicts. The introduction of namespaces in PHP 5.3 and tools like Composer further advanced modularity and organization. Composer automatically generates autoloaders, supporting PSR-4, Classmap, and Files autoloading methods. Additionally, manual autoloading can be set up using spl_autoload_register for customized scenarios.

  5. 5
    Article
    Avatar of lnLaravel News·1y

    Automatic speech recognition and transcription

    Whisper.php is a PHP wrapper for whisper.cpp, a C/C++ port of OpenAI's Whisper model, created by Kyrian Obikwelu. Recently released in version 1.0.0, it facilitates fully local and API-free transcription with features like high and low-level APIs, model auto-downloading, support for various audio formats, and multiple output formats. It requires the FFI extension in PHP and relies on platform-specific shared libraries, downloaded automatically during the first initialization. Whisper.php currently supports Linux and macOS, with Windows support in development.

  6. 6
    Article
    Avatar of lnLaravel News·1y

    Performance Optimization via Conditional Relationship Loading

    Laravel's API Resources feature whenLoaded() allows conditional inclusion of relationship data in API responses, optimizing performance by avoiding unnecessary database queries. Examples showcase dynamic relationship loading based on request parameters, conditional inclusion of nested resources, and optimized query loading for better efficiency.

  7. 7
    Article
    Avatar of communityCommunity Picks·1y

    I may start using Event Sourcing in all my Laravel applications

    Event sourcing is an architectural pattern that logs events in chronological order, providing a complete history of state changes. Unlike traditional systems that store only the current state, event sourcing offers a full audit trail and simplifies debugging and recovery by allowing the replay of events. It's particularly useful for applications that need to track changes over time, though it adds complexity and has a steep learning curve. The author shares experiences using event sourcing in Laravel applications and discusses when it might be overkill for simpler projects.

  8. 8
    Article
    Avatar of communityCommunity Picks·1y

    Make 5x faster outbound requests in Laravel

    Learn how to make outbound HTTP requests up to 5x faster in Laravel using a trick with Laravel Octane. By reusing connections and keeping them as static variables, you can drastically reduce the overhead of repeatedly establishing new connections. This method can be particularly beneficial for applications making frequent external API calls and in scenarios like queues where the application stays in memory.

  9. 9
    Article
    Avatar of lnLaravel News·1y

    One-time Password Manager for Laravel

    The One-time Password (OTP) Manager package for Laravel offers a wide range of methods for generating, sending, verifying, and managing OTPs. It integrates with Laravel's cache system to throttle OTP sending and adds security by tracking requests. Key features include support for multiple OTP types, rate limiting, OTP invalidation after multiple failed attempts, and customizable mobile number validation. Full setup and usage details are available on GitHub.

  10. 10
    Article
    Avatar of thnThe Hacker News·1y

    New Glutton Malware Exploits Popular PHP Frameworks Like Laravel and ThinkPHP

    New Glutton malware has been discovered exploiting popular PHP frameworks like Laravel and ThinkPHP. Linked to the Winnti group, the malware harvests sensitive information, plants backdoors, and employs unconventional methods, including targeting cybercriminals. The attack chain involves modules to assess the environment and infect systems, while modifying system files for persistence. It includes a fully-featured backdoor with 22 commands that further the malware's reach and effectiveness.

  11. 11
    Article
    Avatar of lnLaravel News·1y

    Add Approvals to Your Laravel Application

    The Laravel Process Approval package streamlines the approval process within Laravel applications by automating permission requests and sign-offs. With features like intuitive configuration, multi-step approvals, role-based access, notifications, an audit trail, and customizable views, this package is designed to improve efficiency and compliance for complex approval needs.

  12. 12
    Article
    Avatar of laraveldevLaravel Dev·1y

    Build a Multi-Auth Login System with Laravel

    Learn how to build a multi-auth login system in Laravel that redirects users to different dashboards based on their roles (admin, agent, user). The guide covers setting up a Laravel project, installing the breeze package for authentication, modifying the user migration file, creating a database seeder with dummy data, updating controllers, and routes for role-based redirections.

  13. 13
    Video
    Avatar of codingwithlewisCoding with Lewis·1y

    I Built the Same App in ALL Versions of PHP (1995-2025)

    PHP, released over 30 years ago, has evolved dramatically, becoming a powerful programming language. The post covers recreating an app with every PHP version from 1995 to 2025, showcasing features, improvements, and significant milestones like the introduction of the Zend engine, object-oriented support, and frameworks such as Laravel. PHP's growth and adaptability, especially with modern tools and frameworks, have solidified its place in web development, even though it has faced criticism and competition over the years.

  14. 14
    Article
    Avatar of lnLaravel News·1y

    Laravel Livewire chat package

    Wirechat is a Laravel Livewire chat package designed for real-time private and group communication. It features real-time messaging, media sharing, customizable themes, and smart message deletion. Installation requires PHP 8.1+, Laravel 10+, and Livewire 3.2.3+, and involves running specific commands and integrating the Chatable trait into user models.

  15. 15
    Article
    Avatar of watercoolerWatercooler·1y

    Imposter ඞ

  16. 16
    Article
    Avatar of lnLaravel News·1y

    File Manager Package for Livewire

    The Livewire File Manager package simplifies file and folder management for Laravel applications. Key features include drag & drop, search functionality, multilingual support, and dark mode. It integrates seamlessly with Laravel and uses Spatie's Medialibrary for file handling.

  17. 17
    Article
    Avatar of communityCommunity Picks·1y

    Improving Laravel Sanctum Personal Access Token Performance

    The post discusses an issue with Laravel Sanctum personal access tokens where updating the `last_used_at` column caused a performance bottleneck due to frequent database writes. It provides a solution by creating a custom `PersonalAccessToken` model that overrides the `save()` method to prevent unnecessary writes. The implementation steps include generating the model, modifying the `save()` method, and configuring Sanctum to use the custom model, resulting in improved performance.

  18. 18
    Article
    Avatar of laravelLaravel·1y

    Laravel Nova 5.0 Now Available

    Laravel Nova 5.0 is now available, focusing on modernizing core dependencies, including Inertia 2, PHP 8.1+, Laravel 10+, and introducing new features like Tab Panels for better resource organization and improved field handling. The upgrade guide provides detailed instructions, and the update is free for recent purchases or through license renewal.

  19. 19
    Article
    Avatar of lnLaravel News·1y

    Laravel Jobs

    Many companies are hiring Laravel developers, with several remote positions available. Opportunities range from senior software engineer roles to full-stack developer positions across various regions including the USA, UK, Europe, and Australia. Visit LaraJobs for more listings and hiring options.

  20. 20
    Article
    Avatar of lnLaravel News·1y

    Collect and Monitor Everything About Sent Emails in Your Laravel App

    The Laravel Mails package enables you to log and monitor all sent emails in your Laravel app, including attachments and events. It supports Postmark, collects feedback on delivery status via webhooks, provides notifications for bounces, and offers periodic pruning of logged emails. It's highly configurable and can be integrated with Filament Mails for a visual dashboard.

  21. 21
    Article
    Avatar of lnLaravel News·1y

    Converting Laravel Models to JSON for API Responses

    Laravel provides several methods for transforming Eloquent models into JSON for API responses, with toJson() being one of the simplest options. This method offers significant flexibility, allowing customization of the output through model attributes and relationships. Practical examples show how to use toJson() in controllers for creating structured JSON responses.

  22. 22
    Video
    Avatar of bytegradByteGrad·1y

    Next.js BFF With Separate Backend Is My Favorite Architecture

    The post discusses the benefits of using a separate backend with a Next.js application, highlighting scenarios where this architecture is advantageous. Examples include using different languages, handling heavy processing, and managing large product catalogs independently. The post includes a detailed example of setting up a decoupled backend using WooCommerce on Cloudways, with the front end hosted separately on Vercel, demonstrating how to fetch and display data from the backend in a Next.js app.

  23. 23
    Article
    Avatar of lnLaravel News·1y

    Adding Request Context in Laravel Applications

    Learn how to use Laravel's Context facade to enhance application insight by adding persistent metadata to your requests. This guide provides code examples on implementing context in middleware and API request logging, which enriches logs with valuable debugging information.

  24. 24
    Article
    Avatar of lnLaravel News·1y

    Customizing Data Transformations with Laravel Casts

    Laravel's custom casts allow for tailored data transformations, enabling the handling of complex data types and business logic. Examples include formatting phone numbers and addresses, providing a clean and reusable way to keep models lean and maintainable.

  25. 25
    Article
    Avatar of lnLaravel News·1y

    Flexible Docker Images with PHP INI Environment Variables

    Learn how to enhance flexibility in Docker images by using environment variables for PHP INI settings. This approach allows each developer to configure settings locally without modifying the main configuration files. The post demonstrates how to leverage this feature for Xdebug configuration, providing examples of how to set environment variables in Docker Compose and INI files. Follow these steps to make your Docker setup more adaptable and maintainable.