Sign in

Renato Hysa

@hysa.dev
48 followers 91 following 232 posts

Building @gaplos.com | Crafting the next-gen Laravel boilerplate using DDD (95%+ coverage) | Turning curiosity into code | Open for work 🚀

PostsRepliesMedia
Renato Hysa @hysa.dev · 20/11/2025
🏛️ DDD in Laravel = everything has a home. What you get: ✅ Business logic in Domain layer ✅ Orchestration in Use Cases ✅ Framework code isolated ✅ New devs onboard faster $order->cancel() > $order->status = 'cancelled' Structure brings clarity 🎯 #PHP
020
Renato Hysa @hysa.dev · 13/11/2025
🔥 Unpopular: Model factories are overused. Most tests need: ❌ User::factory()->create() ✅ User::create(['email' => 'test@test.com']) Save factories for: * Database seeding * Complex relationships * Random data generation Be explicit. Be clear 📝 #Laravel
010
Renato Hysa @hysa.dev · 12/11/2025
🔥 Controversial: Static methods are fine, actually. Good static use: ✅ Math::round() ✅ Str::slug() ✅ Carbon::parse() ✅ Validator::make() Bad static use: ❌ DB::query() ❌ Cache::get() Context matters. Stop the dogma 🎯 #PHP
010
Renato Hysa @hysa.dev · 09/11/2025
⚠️ Singleton = anti-pattern alert. Problems: ❌ Cannot mock for tests ❌ Global state ❌ Hidden dependencies ❌ Hard to maintainUse Dependency Injection instead ✅ #PHP
010
Renato Hysa @hysa.dev · 08/11/2025
🏭 Simple Factory = clean object creation. Perfect for: ✅ Dynamic object instantiation ✅ Mockable for testing ✅ Type-based creation ✅ Centralized logic One factory, many objects 🚀 #PHP
010
Renato Hysa @hysa.dev · 07/11/2025
🔄 Prototype = clone instead of create. Perfect for: ✅ Mass data operations ✅ Expensive object creation ✅ Bulk record generation ✅ Pre-configured templatesClone it, don't build it 🚀 #PHP
010
Renato Hysa @hysa.dev · 06/11/2025
♻️ Object Pool = stop wasting time creating objects. Perfect for: ✅ Database connections ✅ HTTP clients ✅ Expensive resources ✅ High-frequency operations Reuse, don't recreate 🚀 #PHP
000
Renato Hysa @hysa.dev · 05/11/2025
🏭 Factory Method = dependency inversion done right. Perfect for: ✅ Multiple logger destinations ✅ Testable with mock factories ✅ Database/file/cloud storage ✅ Zero client code changes SOLID principles in action 💪 #PHP
010
Renato Hysa @hysa.dev · 04/11/2025
🔨 Builder Pattern = no more constructor chaos.Perfect for: ✅ Complex object assembly ✅ Multiple object variations ✅ Step-by-step construction ✅ Avoiding parameter overloadClean, flexible, maintainable 💪 #PHP
010
Renato Hysa @hysa.dev · 03/11/2025
I have used that in the next post, good catch ;)
000
Renato Hysa @hysa.dev · 03/11/2025
🏭 Abstract Factory = object creation made elegant. Perfect for: ✅ Multi-platform apps (Windows/Unix/Mac) ✅ Swappable export formats (CSV/JSON/XML) ✅ Theme systems (Dark/Light) ✅ Test mocking without refactoring One interface, unlimited implementations 🚀 #PHP
010
Renato Hysa @hysa.dev · 01/11/2025
Nested if-statements killing you? Perfect for: ✅ Less cognitive load ✅ Obvious happy path ✅ Fail fast, win clear ✅ Reads like a checklist Guard clauses > pyramids of doom 🛡️ #laravel
131
Renato Hysa @hysa.dev · 31/10/2025
Still writing PHP like it's 2015? Perfect for: ✅ Less constructor boilerplate ✅ Clean match expressions ✅ Arrow function callbacks ✅ Self-documenting calls Modern PHP is clean 🚀 #laravel
010
Renato Hysa @hysa.dev · 28/10/2025
Breaking chains for side effects? Perfect for: ✅ Keep fluent chains flowing ✅ Debug mid-chain easily ✅ Side effects, no breaks ✅ Natural top-to-bottom code The chain never breaks 🔗 #laravel
000
Renato Hysa @hysa.dev · 27/10/2025
Processing huge datasets wrong? Perfect for: ✅ Handle millions of records ✅ Right tool for the job ✅ Safe updates while iterating ✅ Chain methods on big data Memory matters 🧠 #laravel
000
Renato Hysa @hysa.dev · 23/10/2025
Windows users don't know what this screenshot is 😂 #ai
000
Renato Hysa @hysa.dev · 22/10/2025
Interesting, what issues have you had and reached to support? Filament is open source, thus the community is the only support you can get 😅
100
Renato Hysa @hysa.dev · 22/10/2025
Laravel devs Why would someone prefer Laravel Nova over Filament PHP? Especially when you consider that Laravel Nova is a paid option. 🤔 #laravel
120
Renato Hysa @hysa.dev · 19/10/2025
Searching multiple columns with orWhere? Perfect for: ✅ Apply constraint to many columns ✅ No repetitive chains ✅ Clean content filtering ✅ Matches your intent One method beats ten 🎯 #laravel
031
Renato Hysa @hysa.dev · 18/10/2025
It's not about the setup, it's about what you get afterwards, if you use the address VO only once, then it doesn't make sense, but if it is crucial in your domain, why not create 1-2 extra classes?
000
Renato Hysa @hysa.dev · 18/10/2025
This is a great refactoring example!
000
Renato Hysa @hysa.dev · 18/10/2025
Query builder if-statements everywhere? Perfect for: ✅ Conditional clauses, no chain breaks ✅ Clean search filter handling ✅ No nested if-blocks ✅ Default behavior with else Keep the chain flowing 🌊 #laravel
110
Renato Hysa @hysa.dev · 17/10/2025
The before/after diff made my team actually say "wow." 😂 small secrets really.
000
Renato Hysa @hysa.dev · 17/10/2025
Collection closures too verbose? Perfect for: ✅ Call methods without closures ✅ Cleaner transformation chains ✅ Less boilerplate code ✅ Readable nested access One line beats five 📐 #laravel
110
Renato Hysa @hysa.dev · 16/10/2025
Queue jobs killing your API limits? Perfect for: ✅ Respect API rate limits ✅ Prevent service overload ✅ Per-user throttling ✅ No more 429 errors Background work, under control 🎛️ #laravel
000
Renato Hysa @hysa.dev · 16/10/2025
The examples are coming directly from the docs, I love value objects and that one is a good approach ☺️
100
Renato Hysa @hysa.dev · 15/10/2025
Manual JSON encode/decode everywhere? Perfect for: ✅ Rich value objects ✅ Auto encrypt/decrypt ✅ No manual transformation ✅ Encapsulated domain logic Work with objects, store as JSON 🔄 #laravel
100
Renato Hysa @hysa.dev · 14/10/2025
Moved all our user event handling to an observer and deleted 300 lines from the User model, code reviews take half the time now.
000
Renato Hysa @hysa.dev · 14/10/2025
Model event logic scattered everywhere? Perfect for: ✅ Centralized event handling ✅ Clean, focused models ✅ Auto-sync across systems ✅ Isolated testing One observer beats 50 callbacks 🎯 #laravel
110
Renato Hysa @hysa.dev · 13/10/2025
Your API needs rate limiting Perfect for: ✅ Protecting against abuse ✅ Tiered access (free vs paid) ✅ Custom limit segmentation ✅ Fair resource allocation Stop bleeding infrastructure costs 💸 #laravel
011
Renato Hysa @hysa.dev · 12/10/2025
Anyone else been embarrassed by seeing 47 identical queries in Laravel Debugbar because you forgot to cache your collection? 😅 The remember() method is your new best friend!Retry
000
Renato Hysa @hysa.dev · 12/10/2025
🧠 Stop querying the same data twice! Perfect for: ✅ Multi-pass processing ✅ Dashboard aggregations ✅ Complex reports ✅ Data transformations Laravel's remember() caches lazy collection results 💾 #laravel
110
Renato Hysa @hysa.dev · 11/10/2025
🔒 Timing attacks revealing your secrets? Perfect for: ✅ Authentication checks ✅ Password comparisons ✅ Cryptographic operations ✅ API key validations Laravel's Timebox ensures constant execution time 🛡️ #laravel
010
Renato Hysa @hysa.dev · 10/10/2025
This saved us when a client accidentally deleted 500 customer records and we recovered everything in seconds 🙏
010
Renato Hysa @hysa.dev · 10/10/2025
🗑️ Laravel Soft Deletes = Never lose data Perfect for: ✅ Data recovery ✅ Audit trails ✅ Trash features ✅ Compliance needs Records stay in the database, just hidden 🔒 #laravel
110
Renato Hysa @hysa.dev · 09/10/2025
This is me, making sure that my calendar is full with content 🙂 Thank you gaplos.com 😎🙈
010
Renato Hysa @hysa.dev · 08/10/2025
This prevented a double-charge bug in production that could've cost us thousands. 💰
000
Renato Hysa @hysa.dev · 08/10/2025
🔒 Laravel Atomic Locks = Zero race conditions Perfect for: ✅ Duplicate prevention ✅ Critical operations ✅ Distributed coordination No external services needed 🚀 #laravel
110
Renato Hysa @hysa.dev · 07/10/2025
This saved us from a nasty race condition bug that only showed up in production under high load.Retry
000
Renato Hysa @hysa.dev · 07/10/2025
Prevent the same Laravel job from running twice simultaneously. Automatic queue release if job is already processing. Perfect for credit updates, reports, any operation that can't overlap. One line. Zero race conditions. #laravel
100
Renato Hysa @hysa.dev · 06/10/2025
Have you used feature flags in your projects? What's your deployment strategy?
000
Renato Hysa @hysa.dev · 06/10/2025
Laravel Pennant = Feature flags without the complexity Roll out features gradually: ✅ 1% of users first ✅ Kill switch if issues ✅ A/B test variations ✅ Team-based access One Feature::define() call, check anywhere. Database-backed. Built-in caching. No SaaS fees. Pure Laravel. 🔥 #laravel
100
Renato Hysa @hysa.dev · 05/10/2025
If you're building anything with real-time requirements, don't sleep on this feature!
000
Renato Hysa @hysa.dev · 05/10/2025
🤯 Laravel Model Broadcasting = Real-time updates with ZERO boilerplate Add BroadcastsEvents trait to your model & Laravel auto-broadcasts: ✅ Created ✅ Updated ✅ Deleted ✅ Restored No custom events needed. Frontend gets instant updates automatically. This is why I love Laravel 🔥 #laravel
100
Renato Hysa @hysa.dev · 03/10/2025
What feature are you most excited about? 🤔
000
Renato Hysa @hysa.dev · 03/10/2025
🔥 Laravel's HTTP Client fires 3 events you should know about: 🎯 RequestSending - before the request 📨 ResponseReceived - after response ❌ ConnectionFailed - when it fails Perfect for: ✅ Logging all API calls ✅ Monitoring performance ✅ Error tracking Game-changer for API-heavy apps! 🚀 #laravel
100
Renato Hysa @hysa.dev · 13/09/2025
🧠 Your brain isn't built for memorization, it's built for recognizing patterns. Top devs don't memorize every function. They build systems for debugging, code review, and knowledge sharing. Solid systems = everything clicks Broken systems = spinning wheels #laravel #php #remote
030
Renato Hysa @hysa.dev · 11/09/2025
Who would have thought that I would get more views than StackOverflow in 21min. P.S. there are still questions being downvoted out of nothing 😂StackOverflow is a really dark place 😎
010
Renato Hysa @hysa.dev · 10/09/2025
AI cannot do this 😅
010
Renato Hysa @hysa.dev · 09/09/2025
It's Tuesday, I know 😅
000