Ivan Mykhavko

@tegos

Laravel Performance Tip πŸš€
Stop hitting the cache twice! Many devs do `Cache::has()` before `Cache::get()` - but that doubles the work for the same key.
Benchmarks say it all:
- ⏱ Execution: 14ms β†’ 6ms
- 🧠 Memory: 47MB β†’ 43MB
- πŸ”‘ Cache calls: 2 β†’ 1
βœ… Fix: skip `has()`, just `get()` and check for null:

$value = Cache::get($key);
if ($value !== null) return $value;

Tiny tweak, huge impact under load. Full examples and results in the article!
dev.to/tegos/laravel-cache-tip-avoid-redundant-hasmissing-calls-4hi1

#Laravel #PHP #LaravelTips

53

Ivan Mykhavko

@tegos

πŸš€ Excited to share my take on taming business logic in Laravel with Actions & Services! πŸ› οΈ Say goodbye to bloated controllers with my practical approach using OrderCreateAction for operations and DeliveryScheduleService for reusable logic. Check out tips, code examples, and a decision matrix to keep your Laravel projects clean and scalable. Inspired by @nunomaduro and others.
dev.to/tegos/laravel-actions-and-services-360d


#Laravel #PHP #LaravelTips

79

New Tech Short is Live

Learn something new in seconds – check out our latest YouTube Short:
πŸ”— lnkd.in/d4RgFc7E

If you enjoy quick, valuable dev tips and insights, don’t forget to drop a like & subscribe

🌐 Stay connected across all platforms and follow our journey at WebCrux Technology:
πŸ”— lnkd.in/eJdj_Y6n

Let’s build and grow together

#TechWithJinal hashtag#WebCruxTechnology #YouTubeShorts #LaravelTips hashtag#WebDevelopment hashtag#TechCommunity #CodingLife #DevShorts

97

Did you know Laravel provides firstOrCreate() to find a record or create a new one if it doesn’t exist?

If the email exists, it returns the user. Otherwise, it creates a new one.

βœ… Prevents Duplicates
βœ… Saves Multiple Queries

#Laravel #LaravelTips

image

56