When building APIs, Laravel reindexes resource collections numerically by default. For cases where original keys carry meaning, preserveKeys property maintains the intended data structure.
When building APIs, Laravel reindexes resource collections numerically by default. For cases where original keys carry meaning, preserveKeys property maintains the intended data structure.
This week, the Laravel team released v11.36, which includes a chainable Fluent::set()
method, a default global alias for the new Uri
class, and more.
Laravel's custom casts enable tailored data transformations, extending beyond built-in casting capabilities to handle complex data types and business logic.
Wirechat is a new and powerful Laravel Livewire chat package created by Namu Makwembo that brings real-time private and group communication to your application.
Laravel's API resources wrap responses in a 'data' key by default. While useful for many scenarios, sometimes a flatter response structure is needed and you can disable resource wrapping like this:
Laravel's API Resources feature whenLoaded() to conditionally include relationship data in API responses, optimizing performance by preventing unnecessary database queries.
Laravel's Storage::download simplifies secure file serving by providing a clean API for handling downloads while managing file storage abstraction.