• Watch for high RAM consumption (>1MB per request) as sign of inefficient queries
• Track loaded #Eloquent models count to prevent memory bloat
Optimize memory usage and queries:
• Select only needed columns instead of retrieving all fields
#Laravel #Eloquent Performance Tips: Key Database Optimization Tactics
Measure your database performance:
• Use #LaravelDebugBar and #LaravelTelescope to monitor memory usage, query time, and duplicates
Novo app na área pro pessoal do : #Eloquent https://flathub.org/apps/re.sonny.Eloquent
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 #LanguageTool localmente na sua máquina ao qual você pode apontar para que programas como o LibreOffice e Firefox integrem
- LibreOffice: https://help.libreoffice.org/latest/pt-BR/text/shared/optionen/languagetools.html
- Firefox (extensão): https://addons.mozilla.org/en-US/firefox/addon/languagetool/
I just put together a step-by-step guide on how to set up encrypted relationships with Eloquent #php #laravel #eloquent #encryption #security https://poing.gitlab.io/sandstorm/blog/2024/12/09/encrypting-relationships/
Improved workflow in #Laravel: New Reservable trait enables atomic locking for models, preventing race conditions & managing task overlaps.
Demo uses #YouTube video processing with #PHP #cache locks.
Key Implementation Features:
• Built on #Laravel'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 #Eloquent 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 #Laravel commands
Real-world Applications:
• Video processing pipelines
• External API integrations
• Background job management
• Resource-intensive operations
5/14 | You can test #eloquent the #Laravel ORM. It uses the wouterj-nl/symfony-eloquent bundle. Thanks, @wouterjnl, for the pieces of advice and the code reviews. Feature branch: https://github.com/strangebuzz/MicroSymfony/pull/65
$appends is an ant-pattern
#Laravel Enum: A powerful enhancement for PHP enums
Seamlessly integrates with #Laravel (v9.0+) offering advanced enum capabilities
Key features:
• Meta attributes with automatic #Laravel container resolution
• Enhanced cases collection with #Eloquent model casting support
• Built-in #translation management and session key handling
• Complete #PHPUnit test coverage and #PHPStan 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
#FilamentJSONColumn: A simple package for viewing and editing JSON columns in #Filament
• 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 #Filament Form Builder class
• Requires JSON or array column casting in #Eloquent model
#PHP #Laravel #opensource #webdev #JSONeditor
Installation via Composer:
composer require valentin-morice/filament-json-column
GitHub repository:
https://github.com/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.
• #Laravel introduces #CollectedBy attribute for custom #Eloquent collections
• Custom collections encapsulate logic and communicate intent in #PHP applications
• Example: #PostCollection 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: #ProductCollection with methods for pricing, filtering, and categorization
https://alsterholm.com/blog/2024/a-case-for-custom-collections
#DeepSync: New #Laravel package for syncing properties across #Eloquent relationships
Supports #PHP 8.2+ and #Laravel 10+
Enables cascading #softdeletes 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: #Task completion based on #Subtask status
#opensource project available at:
https://github.com/c-tanner/laravel-deep-sync
Meet Cart — your seamless solution for efficient shopping cart management in Laravel. Simplifying everything from product additions to total calculations, Cart ensures a frictionless user experience for e-commerce applications.