phpc.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A server for PHP programmers & friends. Join us for discussions on the PHP programming language, frameworks, packages, tools, open source, tech, life, and more.

Administered by:

Server stats:

702
active users

#eloquent

0 posts0 participants0 posts today
Continued thread

Watch for high RAM consumption (>1MB per request) as sign of inefficient queries
Track loaded models count to prevent memory bloat
Optimize memory usage and queries:
Select only needed columns instead of retrieving all fields

Lessons From Performance Patterns (Cheatsheet)

Optimize DB performance with LaravelDebugBar: track memory, duplicates, and models. Minimize RAM by selecting necessary columns using subqueries. Try chaperone() for circular relationships. Index columns for faster queries.

Novo app na área pro pessoal do : flathub.org/apps/re.sonny.Eloq

Ele resolve algo que eu sinto falta desde que cheguei no Linux, análise gramatical de escrita! Basta colar o texto que escreveu nele para revisão, mas mais importantemente, ele roda um servidor baseado no protocolo do localmente na sua máquina ao qual você pode apontar para que programas como o LibreOffice e Firefox integrem

- LibreOffice: help.libreoffice.org/latest/pt
- Firefox (extensão): addons.mozilla.org/en-US/firef

Flathub - Apps for LinuxInstall Eloquent on Linux | FlathubYour proofreading assistant

Improved workflow in : New Reservable trait enables atomic locking for models, preventing race conditions & managing task overlaps.

Demo uses video processing with locks.

Key Implementation Features:
• Built on 's atomic locking system for guaranteed single-process execution
• Custom trait 'Reservable' simplifies model reservation management
• Flexible interface supporting multiple duration formats & key types
• Integrated with scopes for streamlined queries

️ Developer Benefits:
• Prevents duplicate processing of models in concurrent operations
• Manages failure rates through automatic lock duration
• Reduces external API request frequency on errors
• Supports both manual and scheduled task execution

Technical Highlights:
• Compatible with various cache drivers including database
• Implements force release functionality for specific use cases
• Includes collection & builder macros for cleaner syntax
• Seamless integration with existing commands

Real-world Applications:
• Video processing pipelines
• External API integrations
• Background job management
• Resource-intensive operations

bit.ly/4fPjKkO

bit.lyReservable models in Laravel - Aaron FrancisUsing Laravel's atomic cache locks to reserve models and prevent errors.

Enum: A powerful enhancement for PHP enums

Seamlessly integrates with (v9.0+) offering advanced enum capabilities

Key features:
• Meta attributes with automatic container resolution
• Enhanced cases collection with model casting support
• Built-in management and session key handling
• Complete test coverage and max level compliance

Technical highlights:
• Supports both pure and backed enums
• Implements Arrayable and Jsonable contracts
• Includes bitwise enum capabilities
• Framework-agnostic core available via separate package

Source: github.com/cerbero90/laravel-e

GitHubGitHub - cerbero90/laravel-enum: 🎲 Laravel package to supercharge enum functionalities.🎲 Laravel package to supercharge enum functionalities. - cerbero90/laravel-enum

: A simple package for viewing and editing JSON columns in

Viewer tab: Pretty prints JSON data
Editor tab: Convenient JSON editing
Customizable accent color (default: slateblue)
Adjustable height for both viewer and editor
Option to display only viewer or editor tab
Works with any Form Builder class
Requires JSON or array column casting in model

Installation via Composer:
composer require valentin-morice/filament-json-column

GitHub repository:
github.com/valentin-morice/fil

GitHubGitHub - valentin-morice/filament-json-column: A simple package to view and edit your JSON columns in FilamentA simple package to view and edit your JSON columns in Filament - valentin-morice/filament-json-column

@splitbrain Eloquent has a lot of problems, but:

“I can not believe that one of the most popular ORMs can not create simple JOIN queries!?”

Of course you can using the ->join() method.

But eager loading and joins are two different things, and to me it makes sense to keep them different.

introduces attribute for custom collections

Custom collections encapsulate logic and communicate intent in applications

Example: with keywords() method for specific operations

Useful for primary models in larger apps, handling repeated operations

Consider trade-offs: may introduce indirection, not always necessary for smaller projects

Additional examples: with methods for pricing, filtering, and categorization

alsterholm.com/blog/2024/a-cas

alsterholm.comA Case For Custom CollectionsI recently submitted a pull request to the Laravel framework to add a new Eloquent attribute called CollectedBy. In short, it allows you to use an attribute to configure your Eloquent model to use a specific Collection class, rather than the default...

: New package for syncing properties across relationships

Supports 8.2+ and 10+
Enables cascading and syncing of any model property
Allows omnidirectional syncing (parent-to-child and child-to-parent)
Works with polymorphic relationships
Configurable with verbose logging for debugging
Use case: completion based on status

project available at:
github.com/c-tanner/laravel-de

GitHubGitHub - c-tanner/laravel-deep-sync: Elegantly sync properties across any relationshipElegantly sync properties across any relationship. Contribute to c-tanner/laravel-deep-sync development by creating an account on GitHub.