Best of PHPOctober 2024

  1. 1
    Article
    Avatar of communityCommunity Picks·1y

    Things to do after a fresh laravel install

    When setting up a fresh Laravel installation, consider using the Laravel installer for a streamlined process, including selecting a starter kit such as Inertia/React or Livewire Volt with Class. Recommended packages for enhancing your Laravel setup include Laravel-error-solutions, laravel-schedule-monitor, laravel-env-keys-checker, and tighten/duster. Configuration tips include addressing the n+1 query problem and ensuring JSON responses for API routes in Laravel 11 and above. Example configurations for tlint, pint, and package.json are shared for better project setup.

  2. 2
    Article
    Avatar of communityCommunity Picks·1y

    TheAlgorithms/PHP: All Algorithms implemented in PHP

    The Algorithms - PHP is a library offering a set of algorithms and data structures implemented in PHP, designed to simplify their usage in development projects. Contributions are encouraged, and community support is available via Discord and Gitter.

  3. 3
    Article
    Avatar of lnLaravel News·1y

    API Platform for Laravel

    API Platform simplifies the process of creating modern web APIs using Symfony or Laravel. It allows exposing Eloquent models as REST or GraphQL APIs, dynamically generating OpenAPI specifications, automatic CRUD operations, pagination, validation, and more. The platform also includes tools for securing routes, filtering, and integrating with Laravel's authorization system.

  4. 4
    Article
    Avatar of communityCommunity Picks·2y

    Introduction to Laravel API Development: Setup and Essentials

    Dive into building high-performance APIs with Laravel, a powerful PHP framework. Learn how to set up a new Laravel project, optimize it for API development, and utilize tools like Laravel Breeze, Pest PHP, TablePlus, and PHPStan for streamlined workflow. The guide covers essential topics including data modeling, API design, authentication, rate limiting, versioning, pagination, security, and testing.

  5. 5
    Article
    Avatar of freekFREEK.DEV·2y

    A Guide to Laravel Pipelines

    Learn how to use the Pipeline class in Laravel to break down complex workflows into smaller, isolated processes, and how to test these pipelines effectively.

  6. 6
    Article
    Avatar of lnLaravel News·2y

    Prism is an AI Package for Laravel

    Prism is a Laravel package designed to integrate Large Language Models (LLMs) into applications, providing a unified interface for working with popular AI providers like Anthropic, OpenAI, and Ollama. Key features include elegant provider integrations, a fluent text generation API, seamless tool integration, and flexible configuration options. Full installation instructions and source code are available on GitHub.

  7. 7
    Article
    Avatar of lnLaravel News·1y

    Always Render API Exceptions as JSON in Laravel

    Laravel 11 introduces a new method, `shouldRenderJsonWhen()`, to enforce JSON responses for API exceptions without needing custom middleware. This improvement ensures that exceptions during API requests are always rendered as JSON, enhancing the developer experience when testing API routes in web browsers.

  8. 8
    Article
    Avatar of lnLaravel News·1y

    A Zero-dependency SVG Chart Library for PHP

    The maantje/charts package by Jamie Schouten is a zero-dependency PHP library for generating SVG charts. It offers a simple and intuitive API for creating various chart types including line, bar, stacked, and mixed charts. The package is lightweight, customizable, and outputs pure SVG, which can be embedded in PDFs. Detailed installation instructions and source code are available on GitHub.

  9. 9
    Article
    Avatar of communityCommunity Picks·1y

    A growing list of well built open-source apps in Laravel

    This post presents a curated list of well-built open-source applications created using the Laravel framework, ranging from accounting software to social media platforms. These projects provide valuable learning opportunities and insights into real-world Laravel applications. Readers are encouraged to contribute and suggest more projects to expand the list.

  10. 10
    Video
    Avatar of t3dotggTheo - t3․gg·1y

    I was too dumb for Laravel. Then they fixed it.

    A developer describes their initial struggles with setting up Laravel and how their feedback led to significant improvements in the framework, making it easier to install and use, particularly for those coming from different development backgrounds. The post highlights changes like a new installation method and better logging support, showing how responsive the Laravel team has been to feedback.

  11. 11
    Article
    Avatar of lnLaravel News·1y

    Creating a CLI Application With Laravel and Docker

    Learn how to create a CLI application using Laravel and Docker. The guide provides steps to set up a project, scaffold a command to check stock prices using the Polygon.io API, and prepare the application to run via Docker. It also explains how to configure environment variables for API keys and leverage Docker's ENTRYPOINT instruction for running commands.

  12. 12
    Video
    Avatar of laraveldailyLaravel Daily·2y

    Laravel Roles/Permissions: Complex Multi-Clinic Project

    Managing roles and permissions in a complex multi-clinic project using Laravel involves using Spatie's Laravel Permission package, global scopes, and enums to manage roles within different teams. The project uses a structured, policy-driven approach to permissions, showcasing features like CRUD operations managed by different roles such as master admin, clinic owner, and staff/doctor. Automated testing is emphasized to ensure security, given the high cost of bugs related to unauthorized access.

  13. 13
    Article
    Avatar of communityCommunity Picks·1y

    Flexible Caching in Laravel Made Super Easy

    Laravel 11 introduces a new `Cache::flexible()` method that revolutionizes data caching by using a two-tier Time To Live (TTL) system. This allows serving slightly outdated data while refreshing in the background, balancing data freshness with application performance. The method is illustrated with practical examples like e-commerce recommendations and dashboard analytics, highlighting its benefits in improving performance and responsiveness. However, it's not recommended for security-critical data.

  14. 14
    Article
    Avatar of communityCommunity Picks·1y

    Laravel custom helper functions – Fast Tips

    Helper functions in Laravel are widely popular and make it easy to access reusable code snippets. A common example is the `url()` function for generating application URLs. Another useful function is `retry()`, which retries statements a certain number of times if an exception is thrown, often used in API calls. The post also explains how to create custom helper functions, using `array_map_assoc` as an example, and how to load them via Composer's autoload. This enables you to use custom functions throughout your Laravel application.

  15. 15
    Article
    Avatar of lnLaravel News·1y

    Pan Analytics Viewer

    The Pan Analytics Viewer is a new Laravel package by Lukas Mateffy that allows you to view your `panphp/pan` analytics directly within the UI without using the CLI. Installation is straightforward with a composer command and the addition of a viewer component to your blade template. Make sure to render this component only for users with the necessary permissions to protect the analytics data.

  16. 16
    Video
    Avatar of communityCommunity Picks·1y

    Laravel Livewire Crash Course | Livewire 3 Tutorial for Beginners in 1.5 Hours

    This post provides a crash course on Laravel Livewire, a framework for building dynamic front-end UIs without leaving PHP. It covers the basics of Livewire, including setting up a Laravel project, creating Livewire components, managing state and methods, form handling, and using events to enable communication between components. The post also touches on advanced topics like lazy loading and leveraging Livewire's built-in functionalities for improved user experiences.

  17. 17
    Article
    Avatar of communityCommunity Picks·1y

    Saloon

    Saloon is a PHP library designed to simplify the creation of third-party API integrations and SDKs. It comes production-ready, utilizes Guzzle as its sole dependency, and offers a standardized development flow. Key features include 'Connector' and 'Request' classes for encapsulating API integrations, accurate request recording for tests, and compatibility with any PHP framework. Saloon also supports powerful plugins for caching, rate limits, data transfer, XML, and more.

  18. 18
    Article
    Avatar of communityCommunity Picks·2y

    Using Redis for Caching in Laravel: A Step-by-Step Guide

    Discover how to set up Redis for caching in Laravel applications with this step-by-step guide. Learn about installing Redis and connecting it to Laravel using phpredis, configuring environment variables, and performing various cache operations such as adding, getting, and deleting cache elements. Additionally, understand advanced usage scenarios like key pattern searches and incremental scanning for handling large datasets efficiently.

  19. 19
    Article
    Avatar of lnLaravel News·2y

    WireSpy is a Sleek New Debug Bar for Laravel Livewire

    WireSpy is a new debug bar for Laravel Livewire that allows users to inspect, modify, and debug component states, track events, and enable hot reloading. It was recently released in beta and can be installed via composer. You can toggle it using CMD+L/CTRL+L.

  20. 20
    Article
    Avatar of jetbrainsJetBrains·1y

    PHP Annotated – October 2024

    Welcome to the October edition of PHP Annotated! It covers the latest developments in the PHP community, including the release candidate for PHP 8.4, new security updates for PHP 8.1, 8.2, and 8.3, and PHP Foundation's achievements. Discover new tools like Composer 2.8.0 and php.new, explore AI-driven PHP projects, and review updates from popular PHP frameworks like Symfony and Laravel. A list of upcoming PHP conferences is also included.

  21. 21
    Article
    Avatar of lnLaravel News·1y

    Laravel 11.28 Adds a Composer Dev Command

    Laravel 11.28 introduces several new features, including a `composer run dev` command for easier development setup, a default Tailwind CSS configuration, and a new `CollectedBy` attribute to define custom Collection classes. Additionally, interactive `env:encrypt` and `env:decrypt` commands have been added, along with new helpers for default locale and currency in the Number facade.

  22. 22
    Article
    Avatar of lnLaravel News·1y

    Laravel 11.30 Released

    Laravel 11.30 introduces new features including defer testing helpers, custom unique string IDs for Eloquent models, and support for backed enums with the AuthorizesRequests trait. Highlights include new withDefer() and withoutDefer() test helpers, the HasUniqueStringIds trait for custom IDs, and the ability to directly pass enums to the authorize() method. Additional updates can be reviewed through the GitHub changelog.

  23. 23
    Article
    Avatar of lnLaravel News·1y

    Sprout Multitenancy Package for Laravel

    Laravel Sprout by Ollie Read is a multitenancy package for Laravel that is still in active development and has not yet reached version 1.0. The package aims to provide a feature-rich and flexible multitenancy solution with various tenant identification methods, dependency injection support, Eloquent Tenant support, and initial single database support. Future plans include domain-based tenancy, multi-database support, and more.

  24. 24
    Article
    Avatar of communityCommunity Picks·2y

    Laravel 11 Middleware Configuration: A Comprehensive Guide

    Laravel 11 introduces a new Middleware configuration class that provides a fluent interface for managing your application's middleware stack. The class includes methods for configuring global middleware, middleware groups, static page middleware, and aliases, among others. It allows for easy customization of middleware priorities, API-specific configurations, and session authentication through the `bootstrap/app.php` file.

  25. 25
    Video
    Avatar of primeagenThePrimeTime·1y

    Laravel Creator talks PHP, Lambos, and VC

    In this episode of 'The Top Shelf,' Taylor Otwell, creator of Laravel, discusses the history of Laravel, the recent $57 million raise with Excel, and the technology choices for developing Laravel applications. Otwell explains his preference for Vue.js over React, although Laravel's latest product, Laravel Cloud, uses React due to its extensive ecosystem. The conversation delves into Inertia.js, a project that allows developers to write full-stack applications with modern JavaScript front ends while keeping traditional server-side routing and data retrieval. Otwell also shares insights into maintaining Laravel's code quality and the importance of building the hardest part of a project first.