ð§ Fixed Laravel Bug (and Got My PR Merged!)
Tried to delete 500 rows with batch... Laravel deleted 500,000+ at once ð
Turns out, DELETE queries with JOIN + LIMIT/ORDER BY were dropping those clauses - wiping out way more than intended.
I patched it so Laravel now keeps the full query and lets MySQL handle errors properly.
Merged into Laravel 13.x ð
â
No more silent mass deletions
ð Open source wins again
dev.to/tegos/battling-laravels-sneaky-deletes-how-i-got-order-by-and-limit-to-play-nice-with-joins-ng9
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
ð Optimized my Laravel vendor/ folder and cut it from 200.6 MB â 119.8 MB (40% lighter) ðŠķ
Result: faster deploys, smaller Docker images, smoother CI/CD.
Inspired by @jclermont article on trimming the AWS SDK, I ran my own cleanup experiment and shared the steps here:
dev.to/tegos/optimize-vendor-folder-size-1m01
#Laravel #PHP #DevOps
ð 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