Recent posts with #Php

Just updated my PR for Laravel Rector! 💪

It now converts array access → Arr::get() (instead of data_get()) for:
✔️ Simple keys
✔️ Nested keys (dot notation)
✔️ Defaults
✔️ Preserves throw expressions
Cleaner & safer Laravel array handling ✨
#Laravel #PHP #Rector
image

1

35

58

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

51