Best of PHPJuly 2024

  1. 1
    Article
    Avatar of phpdevPHP Dev·2y

    Laravel Tip - PHP

    Leverage Eloquent's relationship method in Laravel to simplify your code. This approach is cleaner, more expressive, and compatible with any 'belongs to' relationship.

  2. 2
    Article
    Avatar of communityCommunity Picks·2y

    10 Large Open-Source Projects Built with Laravel

    Laravel is popular for building various web applications, and here are 10 notable open-source projects created using it. These projects range from personal CRMs and music streaming servers to invoicing solutions and game server management panels. Each project utilizes different versions and aspects of the Laravel ecosystem, such as Laravel UI, Pint, Socialite, and more.

  3. 3
    Article
    Avatar of communityCommunity Picks·2y

    Don't query your PostgreSQL db anymore, prefer PostgREST

    The post discusses the benefits of using PostgREST to replace traditional SQL queries in PostgreSQL databases. It outlines the process of setting up PostgREST, a standalone web server that converts PostgreSQL databases into RESTful APIs, simplifying database interactions. The author shares their experience migrating from MySQL to PostgreSQL and how PostgREST helped streamline their PHP code by eliminating direct SQL queries. The post includes a tutorial on setting up and using PostgREST with Docker, illustrating various query examples and security considerations.

  4. 4
    Article
    Avatar of communityCommunity Picks·2y

    My work setup for PHP development

    The post discusses the author's work setup for PHP development, involving a mix of hardware and software. The main work machine runs Windows 11 with Ubuntu under WSL, a MacBook Pro for corporate tasks, and a ChromeOS laptop for flexible workspaces. Key productivity tools include Barrier for multi-device control, WezTerm for terminal tasks, zsh as the shell, Neovim as the code editor, and tmux with tmuxinator for session management. The author also highlights Ddev for managing containerized environments efficiently.

  5. 5
    Article
    Avatar of communityCommunity Picks·2y

    PHP Cheat Sheet

    A quick reference guide for PHP, featuring functions references, regular expression syntax guide, and date formatting functions. Now includes popup links to the relevant PHP manual pages for easy access to detailed information.

  6. 6
    Article
    Avatar of communityCommunity Picks·2y

    Laravel Admin Panel

    Orchid simplifies the development of admin panels in Laravel, allowing developers to focus on application logic. It comes with comprehensive documentation and examples for quick implementation. Features include a variety of UI components, easy management of user permissions, flexible attachment options for files, and adherence to W3C standards for customization. All code is open-source and community-developed.

  7. 7
    Article
    Avatar of stitcherstitcher.io·2y

    New without parentheses in PHP 8.4

    PHP 8.4 introduces a feature allowing developers to create new objects without parentheses, simplifying code and enabling method chaining directly on newly created objects. This update extends to methods, properties, static methods, and even supports dynamic and anonymous classes. However, constructor brackets remain mandatory for class instantiation to avoid parsing ambiguities. Despite minor limitations, this syntactic sugar promises to enhance coding efficiency.

  8. 8
    Article
    Avatar of communityCommunity Picks·2y

    Deployer - The deployment tool for PHP

    Deployer is a PHP deployment tool that supports popular frameworks and offers features like server provisioning, zero downtime deployments, and ready-to-use recipes for various applications. It can configure firewalls, install PHP and databases, and set up HTTPS, providing robust rollback capabilities in case something goes wrong.

  9. 9
    Article
    Avatar of lnLaravel News·2y

    API Versioning in Laravel 11

    Laravel 11 has streamlined its application skeleton by removing unnecessary service providers and default API routes. If you need to set up an API, you can use the `php artisan install:api` command to configure routes and necessary files. For API versioning, you can either add versioned routes in separate files like `routes/api_v1.php` and `routes/api_v2.php`, or configure them directly in the `bootstrap/app.php` file. This article provides step-by-step instructions for both methods to keep your routes organized.

  10. 10
    Article
    Avatar of lnLaravel News·2y

    Introducing Built with Laravel

    BuiltWithLaravel.com is a new site created by Matt Stauffer to showcase companies and organizations using Laravel. The site aims to convince potential clients of Laravel's legitimacy by listing notable organizations that use it. Users can also suggest companies for inclusion through a suggestion form. The focus is on a curated list of impressive organizations rather than a comprehensive one.

  11. 11
    Article
    Avatar of lnLaravel News·2y

    Auth Screens for Your Laravel Apps

    Managing multiple Laravel applications becomes simpler with DevDojo Auth, a free, open-source project offering customizable authentication pages compatible with Laravel 10.x and higher. Installation involves using Composer and publishing assets and configurations. The package allows for extensive customization, including setting up social authentication using provider credentials. Additional features include Github action workflows and built-in testing tools like Pest and Dusk.

  12. 12
    Article
    Avatar of stitcherstitcher.io·2y

    Improved lazy loading

    The post discusses the design and implementation of an ORM named Tempest, focusing on improved lazy loading mechanisms. The key approach includes using typed properties for static analysis, making minimal configuration necessary by inferring relations directly from property types and docblocks. It contrasts Tempest's strict lazy loading with Laravel's default approach which allows lazy loading, thereby preventing n+1 query problems and optimizing performance. The post also explores PHP's technical details, including handling uninitialized properties and triggering property accessors for lazy loading.

  13. 13
    Article
    Avatar of stitcherstitcher.io·2y

    array_find in PHP 8.4

    PHP 8.4 introduces new functions such as array_find(), array_find_key(), array_any(), and array_all(). array_find() returns the first element that matches a callback condition, while array_find_key() returns the corresponding key. array_any() checks if at least one element satisfies the condition, and array_all() confirms if all elements do.

  14. 14
    Article
    Avatar of jetbrainsJetBrains·2y

    The Best Laravel Tutorials and Resources for Developers

    Learn Laravel efficiently with top resources including structured online courses like Laracasts, Laravel Daily, Codecourse, Udemy, and Coursera. Enhance your skills with comprehensive books such as 'Laravel: Up & Running' by Matt Stauffer. Use YouTube channels like Traversy Media and The Net Ninja for engaging video tutorials. Stay updated with the official Laravel documentation, Laravel News, and community resources like the Laracasts forum and Laravel.io.

  15. 15
    Article
    Avatar of hnHacker News·2y

    Video Editing SDK

    The post highlights how a video editing SDK can be seamlessly integrated with various platforms, including React, Angular, PHP, and HTML.

  16. 16
    Article
    Avatar of lnLaravel News·2y

    Build SSH Apps with PHP and Laravel Prompts

    The ssh-php project by Sam Carré offers a simple starting point for building Text-based User Interfaces (TUIs) over SSH using PHP. It integrates Laravel Prompts, Chewie, and Docker, facilitating both development and deployment. The project includes commands for running an SSH server in a Docker container and connecting to it. Comprehensive installation instructions and resources are available on GitHub.

  17. 17
    Article
    Avatar of lnLaravel News·2y

    Build Custom Admin Panels With Backpack for Laravel

    Backpack for Laravel is a collection of packages designed to create highly customizable admin panels quickly. It offers various core and extension packages, some of which are free. Core packages include Backpack CRUD and the paid Backpack PRO addon. Ready-made CRUDs such as Permission Manager, Settings, Page Manager, NewsCRUD, and MenuCRUD are provided for common admin tasks. Extensions offer additional functionalities like backup management, log management, translation management, and more. There are also themes and community addons available. Backpack pricing includes various tiers, with a potential 20% discount using the 'LARAVELNEWS' coupon.

  18. 18
    Article
    Avatar of communityCommunity Picks·2y

    Magic Constants in PHP

    PHP provides 9 magic constants that hold special compile-time information. These include __FUNCTION__, __METHOD__, __CLASS__, ::class, __TRAIT__, __NAMESPACE__, __LINE__, __FILE__, and __DIR__. These constants can be useful for retrieving context-specific data like current function name, method name, class name, and file paths. Examples illustrate how each constant behaves in different scenarios, including within classes, traits, namespaces, and anonymous functions.

  19. 19
    Article
    Avatar of communityCommunity Picks·2y

    Laravel In Depth: Understanding Laravel Macros

    Laravel macros allow developers to dynamically add new methods to existing classes at runtime, enhancing the functionality of Laravel's core classes without modifying the source code. Through the use of macros and mixins, developers can increase code reusability and create concise, readable code. This guide explores the definition, purpose, and benefits of macroables, demonstrates how to register and invoke macros, and provides real-world examples including the use of mixins for more organized code.

  20. 20
    Article
    Avatar of stitcherstitcher.io·2y

    stitcher.io

    A developer advocate for PHP at JetBrains shares an inspiring story of how a single blog post led to an unexpected career opportunity. The narrative emphasizes the importance of writing and putting content out to the public, not driven by fame or goals but for the love of it. It underlines that working on what makes you happy can lead to great places, and the author reflects on their journey from a casual blogger to their current role.

  21. 21
    Article
    Avatar of phpdevPHP Dev·2y

    Laravel Tip

    The post discusses two options for performing migration and seeding tasks in Laravel, inviting readers to share their preferences between Option A and Option B.

  22. 22
    Article
    Avatar of lnLaravel News·2y

    Building fast, fuzzy site search with Laravel and Typesense

    Learn how to create a fast and fuzzy search functionality in a Laravel application using Typesense. The author provides a step-by-step guide to setting up a Todo model, configuring Laravel Scout, and creating Laravel Controllers and Views to synchronize data with Typesense. This setup allows developers to easily implement advanced search features, including handling typographical errors, with minimal code changes.