Renato Hysa
hysa.dev
Renato Hysa
@hysa.dev
Building
@gaplos.com
| Crafting the next-gen Laravel boilerplate using DDD (95%+ coverage) | Turning curiosity into code | Open for work 🚀
🔥 Unpopular: Model factories are overused.

Most tests need:
❌ User::factory()->create()
✅ User::create(['email' => '[email protected]'])

Save factories for:
* Database seeding
* Complex relationships
* Random data generation

Be explicit. Be clear 📝

#Laravel
November 13, 2025 at 2:00 PM
🔥 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
November 12, 2025 at 2:00 PM
⚠️ Singleton = anti-pattern alert.

Problems:

❌ Cannot mock for tests
❌ Global state
❌ Hidden dependencies
❌ Hard to maintainUse Dependency Injection instead ✅

#PHP
November 9, 2025 at 3:00 PM
🏭 Simple Factory = clean object creation.

Perfect for:
✅ Dynamic object instantiation
✅ Mockable for testing
✅ Type-based creation
✅ Centralized logic

One factory, many objects 🚀

#PHP
November 8, 2025 at 3:00 PM
🔄 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
November 7, 2025 at 3:00 PM
♻️ Object Pool = stop wasting time creating objects.

Perfect for:
✅ Database connections
✅ HTTP clients
✅ Expensive resources
✅ High-frequency operations

Reuse, don't recreate 🚀

#PHP
November 6, 2025 at 3:00 PM
🏭 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
November 5, 2025 at 3:00 PM
🔨 Builder Pattern = no more constructor chaos.Perfect for:

✅ Complex object assembly
✅ Multiple object variations
✅ Step-by-step construction
✅ Avoiding parameter overloadClean, flexible, maintainable 💪

#PHP
November 4, 2025 at 3:00 PM
🏭 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
November 3, 2025 at 12:13 PM
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
November 1, 2025 at 2:00 PM
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
October 31, 2025 at 12:07 PM
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
October 28, 2025 at 1:00 PM
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
October 27, 2025 at 12:05 PM
Windows users don't know what this screenshot is 😂

#ai
October 23, 2025 at 8:07 AM
Laravel devs

Why would someone prefer Laravel Nova over Filament PHP? Especially when you consider that Laravel Nova is a paid option. 🤔

#laravel
October 22, 2025 at 4:01 PM
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
October 19, 2025 at 8:00 AM
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
October 18, 2025 at 8:00 AM
Collection closures too verbose?

Perfect for:
✅ Call methods without closures
✅ Cleaner transformation chains
✅ Less boilerplate code
✅ Readable nested access

One line beats five 📐

#laravel
October 17, 2025 at 2:00 PM
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
October 16, 2025 at 2:00 PM
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
October 15, 2025 at 2:00 PM
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
October 14, 2025 at 2:00 PM
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
October 13, 2025 at 2:00 PM
🧠 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
October 12, 2025 at 4:00 PM
🔒 Timing attacks revealing your secrets?

Perfect for:
✅ Authentication checks
✅ Password comparisons
✅ Cryptographic operations
✅ API key validations

Laravel's Timebox ensures constant execution time 🛡️

#laravel
October 11, 2025 at 7:00 PM
🗑️ Laravel Soft Deletes = Never lose data

Perfect for:
✅ Data recovery
✅ Audit trails
✅ Trash features
✅ Compliance needs

Records stay in the database, just hidden 🔒

#laravel
October 10, 2025 at 7:00 AM