Renato Hysa (@renatohysa) 's Twitter Profile
Renato Hysa

@renatohysa

Building @thelisting_app | Crafting the next-gen Laravel boilerplate using DDD (95%+ coverage) | Turning curiosity into code | Open for work πŸš€

ID: 2731278852

linkhttp://www.hysa.dev calendar_today14-08-2014 09:29:01

311 Tweet

99 Followers

310 Following

Renato Hysa (@renatohysa) 's Twitter Profile Photo

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 🎯 {{laravelhashtag}}

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 🎯

{{laravelhashtag}}
Renato Hysa (@renatohysa) 's Twitter Profile Photo

Laravel devs Why would someone prefer Laravel Nova over Filament PHP? Especially when you consider that Laravel Nova is a paid option. πŸ€” #laravel

Renato Hysa (@renatohysa) 's Twitter Profile Photo

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 🧠 {{laravelhashtag}}

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 🧠

{{laravelhashtag}}
Renato Hysa (@renatohysa) 's Twitter Profile Photo

How cool is this? 😦 gaplos.com doesn't only support publishing to 8 platform (Facebook, Instagram, Threads, LinkedIn, X, BlueSky, TikTok, and Telegram), but starting from today it also supports polls.

Renato Hysa (@renatohysa) 's Twitter Profile Photo

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 πŸ”— {{laravelhashtag}}

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 πŸ”—

{{laravelhashtag}}
Renato Hysa (@renatohysa) 's Twitter Profile Photo

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

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
Renato Hysa (@renatohysa) 's Twitter Profile Photo

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

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
Renato Hysa (@renatohysa) 's Twitter Profile Photo

Stop Using Switch Statements for Algorithms The Strategy Pattern is perfect for this Perfect for: βœ… Add behaviors without edits βœ… Isolated testing βœ… No giant switches βœ… SOLID in practice One algorithm, one class 🎯 #laravel

Stop Using Switch Statements for Algorithms

The Strategy Pattern is perfect for this

Perfect for:
βœ… Add behaviors without edits
βœ… Isolated testing
βœ… No giant switches
βœ… SOLID in practice

One algorithm, one class 🎯

#laravel
Renato Hysa (@renatohysa) 's Twitter Profile Photo

🏭 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

🏭 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
Renato Hysa (@renatohysa) 's Twitter Profile Photo

πŸ”¨ Builder Pattern = no more constructor chaos.Perfect for: βœ… Complex object assembly βœ… Multiple object variations βœ… Step-by-step construction βœ… Avoiding parameter overloadClean, flexible, maintainable πŸ’ͺ #PHP

πŸ”¨ Builder Pattern = no more constructor chaos.Perfect for:

βœ… Complex object assembly
βœ… Multiple object variations
βœ… Step-by-step construction
βœ… Avoiding parameter overloadClean, flexible, maintainable πŸ’ͺ

#PHP
Renato Hysa (@renatohysa) 's Twitter Profile Photo

🏭 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

🏭 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
Renato Hysa (@renatohysa) 's Twitter Profile Photo

♻️ Object Pool = stop wasting time creating objects. Perfect for: βœ… Database connections βœ… HTTP clients βœ… Expensive resources βœ… High-frequency operations Reuse, don't recreate πŸš€ #PHP

♻️ Object Pool = stop wasting time creating objects.

Perfect for:
βœ… Database connections
βœ… HTTP clients
βœ… Expensive resources
βœ… High-frequency operations

Reuse, don't recreate πŸš€

#PHP
Renato Hysa (@renatohysa) 's Twitter Profile Photo

πŸ”„ 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

πŸ”„ 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
Renato Hysa (@renatohysa) 's Twitter Profile Photo

🏭 Simple Factory = clean object creation. Perfect for: βœ… Dynamic object instantiation βœ… Mockable for testing βœ… Type-based creation βœ… Centralized logic One factory, many objects πŸš€ #PHP

🏭 Simple Factory = clean object creation.

Perfect for:
βœ… Dynamic object instantiation
βœ… Mockable for testing
βœ… Type-based creation
βœ… Centralized logic

One factory, many objects πŸš€

#PHP
Renato Hysa (@renatohysa) 's Twitter Profile Photo

⚠️ Singleton = anti-pattern alert. Problems: ❌ Cannot mock for tests ❌ Global state ❌ Hidden dependencies ❌ Hard to maintainUse Dependency Injection instead βœ… #PHP

⚠️ Singleton = anti-pattern alert.

Problems:

❌ Cannot mock for tests
❌ Global state
❌ Hidden dependencies
❌ Hard to maintainUse Dependency Injection instead βœ…

#PHP
Renato Hysa (@renatohysa) 's Twitter Profile Photo

πŸ”₯ 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

Renato Hysa (@renatohysa) 's Twitter Profile Photo

πŸ”₯ 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

Renato Hysa (@renatohysa) 's Twitter Profile Photo

πŸ›οΈ 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