Articles | Mohamed Said      [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://msaied.com) - [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [About](https://msaied.com#about)

           [  Contact](https://msaied.com#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://msaied.com)
- [ProjectsCase studies](https://msaied.com/projects)
- [ArticlesEngineering notes](https://msaied.com/articles)
- [CertificatesCredentials](https://msaied.com/certificates)
- [AboutHow I work](https://msaied.com#about)
- [ContactGet in touch](https://msaied.com#contact)

  [Start a conversation](https://msaied.com#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

  1. [Home](https://msaied.com)
2. /
3. Articles

  Engineering library
====================

 100 articles by Mohamed Said on Laravel, PHP, databases, APIs and infrastructure, written from production work.

 Search articles ⌕×Search 

    Topic hubs
----------

←→

- [AI53 articles](https://msaied.com/articles?category=ai&search=eloquent&sort=new)
- [Composer Pacakge85 articles](https://msaied.com/articles?category=composer-pacakge&search=eloquent&sort=new)
- [Filament31 articles](https://msaied.com/articles?category=filament&search=eloquent&sort=new)
- [Laravel292 articles](https://msaied.com/articles?category=laravel&search=eloquent&sort=new)
- [Livewire16 articles](https://msaied.com/articles?category=livewire&search=eloquent&sort=new)
- [Open Source48 articles](https://msaied.com/articles?category=open-source&search=eloquent&sort=new)
- [PHP34 articles](https://msaied.com/articles?category=php&search=eloquent&sort=new)
- [Tips &amp; Tricks37 articles](https://msaied.com/articles?category=tips-tricks&search=eloquent&sort=new)

  Topics
------

 [All topics](https://msaied.com/articles?search=eloquent&sort=new) [AI 53](https://msaied.com/articles?category=ai&search=eloquent&sort=new) [Composer Pacakge 85](https://msaied.com/articles?category=composer-pacakge&search=eloquent&sort=new) [Filament 31](https://msaied.com/articles?category=filament&search=eloquent&sort=new) [Laravel 292](https://msaied.com/articles?category=laravel&search=eloquent&sort=new) [Livewire 16](https://msaied.com/articles?category=livewire&search=eloquent&sort=new) [Open Source 48](https://msaied.com/articles?category=open-source&search=eloquent&sort=new) [PHP 34](https://msaied.com/articles?category=php&search=eloquent&sort=new) [Tips &amp; Tricks 37](https://msaied.com/articles?category=tips-tricks&search=eloquent&sort=new)    100 articles
-------------

Topics    Sort articles Newest first  Oldest first  Sort  

 [Search: eloquent ×Remove search](https://msaied.com/articles?sort=new) [ Clear filters](https://msaied.com/articles) 

  [![](https://cdn.msaied.com/265/e97881aef9580e1f0b9e1bd6890d828a.png)](https://msaied.com/articles/mysql-explain-and-index-optimization-for-laravel-developers)22 Jun 2026·4 min read 

### [MySQL EXPLAIN and Index Optimization for Laravel Developers](https://msaied.com/articles/mysql-explain-and-index-optimization-for-laravel-developers) 

 Stop guessing why your Laravel queries are slow. Learn to read EXPLAIN output, spot full table scans, and design indexes that actually get used — with real Eloquent examples throughout.

   [![](https://cdn.msaied.com/254/59db6572be67edba52aebb3fdc4951dc.png)](https://msaied.com/articles/event-sourcing-in-laravel-aggregates-projectors-and-reactors-without-the-framework-tax-1)21 Jun 2026·4 min read 

### [Event Sourcing in Laravel: Aggregates, Projectors, and Reactors Without the Framework Tax](https://msaied.com/articles/event-sourcing-in-laravel-aggregates-projectors-and-reactors-without-the-framework-tax-1) 

 Skip the magic black boxes. Learn how to implement event sourcing in Laravel using plain PHP aggregates, Eloquent projectors, and queue-driven reactors — keeping full control over your event store.

   [![](https://cdn.msaied.com/241/32858f9c67eae0649999c32a6d31818f.png)](https://msaied.com/articles/postgresql-ctes-recursive-queries-and-lateral-joins-in-laravel)19 Jun 2026·3 min read 

### [PostgreSQL CTEs, Recursive Queries, and Lateral Joins in Laravel](https://msaied.com/articles/postgresql-ctes-recursive-queries-and-lateral-joins-in-laravel) 

 Go beyond basic Eloquent with raw PostgreSQL power: composable CTEs, recursive tree traversal, and LATERAL joins — all wired cleanly into Laravel's query builder.

   [![](https://cdn.msaied.com/238/8e843e57a34f81f853eedefae629c09b.png)](https://msaied.com/articles/custom-eloquent-casts-encapsulating-domain-logic-inside-model-attributes)19 Jun 2026·3 min read 

### [Custom Eloquent Casts: Encapsulating Domain Logic Inside Model Attributes](https://msaied.com/articles/custom-eloquent-casts-encapsulating-domain-logic-inside-model-attributes) 

 Custom Eloquent casts let you push value-object logic directly into model attributes, keeping controllers and services thin. This article shows how to build production-grade casts with validation, serialization, and testability.

   [![](https://cdn.msaied.com/220/967a0feff7428e3f2a68209163804743.png)](https://msaied.com/articles/read-model-projections-in-laravel-without-full-event-sourcing)17 Jun 2026·4 min read 

### [Read Model Projections in Laravel Without Full Event Sourcing](https://msaied.com/articles/read-model-projections-in-laravel-without-full-event-sourcing) 

 Learn how to build fast, queryable read models in Laravel using database projectors and Eloquent—without committing to a full event-sourcing stack. Practical patterns, real code, zero ceremony.

   [![](https://cdn.msaied.com/219/c16eb6ef2428da6f1d4a18025bf6c15d.png)](https://msaied.com/articles/laravel-observers-vs-model-events-choosing-the-right-hook-for-side-effects)16 Jun 2026·4 min read 

### [Laravel Observers vs. Model Events: Choosing the Right Hook for Side Effects](https://msaied.com/articles/laravel-observers-vs-model-events-choosing-the-right-hook-for-side-effects) 

 Model events and observers both react to Eloquent lifecycle changes, but picking the wrong one creates tangled, untestable code. Here is a precise guide to when each belongs in a production Laravel codebase.

   [![](https://cdn.msaied.com/211/8b9b19e7ecbf690b182ffbe6bffc9530.png)](https://msaied.com/articles/laravel-eloquent-global-scopes-pitfalls-testing-and-composing-them-safely)16 Jun 2026·1 min read 

### [Laravel Eloquent Global Scopes: Pitfalls, Testing, and Composing Them Safely](https://msaied.com/articles/laravel-eloquent-global-scopes-pitfalls-testing-and-composing-them-safely) 

 Global scopes are powerful but easy to misuse. Learn how to write, test, and safely compose Eloquent global scopes without leaking state or breaking queries in unexpected ways.

   [![](https://cdn.msaied.com/210/b47272214946c6adcd02ddf74b7df816.png)](https://msaied.com/articles/eloquent-custom-relations-polymorphic-pivots-hasmanythrough-tricks-and-raw-join-relations)16 Jun 2026·3 min read 

### [Eloquent Custom Relations: Polymorphic Pivots, HasManyThrough Tricks, and Raw Join Relations](https://msaied.com/articles/eloquent-custom-relations-polymorphic-pivots-hasmanythrough-tricks-and-raw-join-relations) 

 Beyond belongsTo and hasMany lies a set of underused Eloquent relation techniques. This guide covers custom relation classes, raw-join relations, and HasManyThrough edge cases that eliminate ugly query workarounds.

   [![](https://cdn.msaied.com/205/019d80d4be977814ed6353286ef25688.png)](https://msaied.com/articles/blackfire-xdebug-profiling-in-laravel-finding-real-bottlenecks)16 Jun 2026·3 min read 

### [Blackfire &amp; Xdebug Profiling in Laravel: Finding Real Bottlenecks](https://msaied.com/articles/blackfire-xdebug-profiling-in-laravel-finding-real-bottlenecks) 

 Stop guessing where your Laravel app is slow. This guide walks through practical Blackfire and Xdebug profiling workflows to pinpoint real bottlenecks in routes, jobs, and Eloquent queries.

   [← Newer](https://msaied.com/articles?search=eloquent&page=9)1. [1](https://msaied.com/articles?search=eloquent&page=1)
2. [2](https://msaied.com/articles?search=eloquent&page=2)
3. [3](https://msaied.com/articles?search=eloquent&page=3)
4. [4](https://msaied.com/articles?search=eloquent&page=4)
5. [5](https://msaied.com/articles?search=eloquent&page=5)
6. [6](https://msaied.com/articles?search=eloquent&page=6)
7. [7](https://msaied.com/articles?search=eloquent&page=7)
8. [8](https://msaied.com/articles?search=eloquent&page=8)
9. [9](https://msaied.com/articles?search=eloquent&page=9)
10. 10
11. [11](https://msaied.com/articles?search=eloquent&page=11)
12. [12](https://msaied.com/articles?search=eloquent&page=12)

 10 / 12 [Older →](https://msaied.com/articles?search=eloquent&page=11)   

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://msaied.com#contact) 

Topics
------

Close 

 [All topics](https://msaied.com/articles) [AI (53) ](https://msaied.com/articles?category=ai&search=eloquent&sort=new) [Composer Pacakge (85) ](https://msaied.com/articles?category=composer-pacakge&search=eloquent&sort=new) [Filament (31) ](https://msaied.com/articles?category=filament&search=eloquent&sort=new) [Laravel (292) ](https://msaied.com/articles?category=laravel&search=eloquent&sort=new) [Livewire (16) ](https://msaied.com/articles?category=livewire&search=eloquent&sort=new) [Open Source (48) ](https://msaied.com/articles?category=open-source&search=eloquent&sort=new) [PHP (34) ](https://msaied.com/articles?category=php&search=eloquent&sort=new) [Tips &amp; Tricks (37) ](https://msaied.com/articles?category=tips-tricks&search=eloquent&sort=new)  

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://msaied.com)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://msaied.com/sitemap.xml)
