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/434/ebfa76586107d613c3d3e65695f16ae4.png)](https://msaied.com/articles/eloquent-custom-casts-encapsulating-value-objects-without-the-bloat-1)17 Jul 2026·1 min read 

### [Eloquent Custom Casts: Encapsulating Value Objects Without the Bloat](https://msaied.com/articles/eloquent-custom-casts-encapsulating-value-objects-without-the-bloat-1) 

 Custom Eloquent casts let you map raw database columns directly to rich value objects. Learn how to build type-safe, testable casts that keep your models clean and your domain logic where it belongs.

   [![](https://cdn.msaied.com/425/07a543ad383be3d55de9ed21cf7509d5.png)](https://msaied.com/articles/postgresql-ctes-window-functions-and-lateral-joins-in-laravel-3)14 Jul 2026·2 min read 

### [PostgreSQL CTEs, Window Functions, and Lateral Joins in Laravel](https://msaied.com/articles/postgresql-ctes-window-functions-and-lateral-joins-in-laravel-3) 

 Go beyond basic Eloquent queries: learn how to leverage PostgreSQL CTEs, window functions, and LATERAL joins directly in Laravel for complex reporting and ranking queries without sacrificing maintainability.

   [![](https://cdn.msaied.com/421/d1aeb29c36e4b62b103b6a2e0a534590.png)](https://msaied.com/articles/postgresql-full-text-search-in-laravel-indexes-ts-rank-and-weighted-queries)13 Jul 2026·4 min read 

### [PostgreSQL Full-Text Search in Laravel: Indexes, ts\_rank, and Weighted Queries](https://msaied.com/articles/postgresql-full-text-search-in-laravel-indexes-ts-rank-and-weighted-queries) 

 Skip Algolia for many use cases. PostgreSQL's built-in full-text search handles ranked, weighted, multi-column queries well. Here's how to wire it cleanly into Laravel with proper indexes and Eloquent scopes.

   [![](https://cdn.msaied.com/415/eb2d62822119280148e092d25b36c6ae.png)](https://msaied.com/articles/cursor-pagination-chunked-iteration-and-lazy-collections-at-scale-in-laravel-2)12 Jul 2026·4 min read 

### [Cursor Pagination, Chunked Iteration, and Lazy Collections at Scale in Laravel](https://msaied.com/articles/cursor-pagination-chunked-iteration-and-lazy-collections-at-scale-in-laravel-2) 

 Offset pagination breaks under large datasets. Learn how cursor pagination, chunked iteration, and lazy collections each solve different scale problems in Laravel Eloquent — with real query trade-offs explained.

   [![](https://cdn.msaied.com/413/ec9d48bb1167db4a2ec2e0784f3be002.png)](https://msaied.com/articles/laravel-observers-vs-model-events-choosing-the-right-hook-for-side-effects-1)11 Jul 2026·3 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-1) 

 Model events and observers both react to Eloquent lifecycle moments, but picking the wrong one creates hidden coupling and untestable code. Here is a practical guide to choosing correctly.

   [![](https://cdn.msaied.com/408/3534df365ffb2c8f6c430180bfaba8f1.png)](https://msaied.com/articles/laravel-enum-casts-backed-enums-and-value-semantics-in-php-83)10 Jul 2026·1 min read 

### [Laravel Enum Casts, Backed Enums, and Value Semantics in PHP 8.3](https://msaied.com/articles/laravel-enum-casts-backed-enums-and-value-semantics-in-php-83) 

 PHP 8.3 backed enums combined with Laravel's native enum casting unlock type-safe domain models. Learn how to wire enums into Eloquent, validation, and API resources without ceremony.

   [![](https://cdn.msaied.com/405/9567c07e9cdd10de853dc989784f6c5c.png)](https://msaied.com/articles/eloquent-custom-relations-building-a-hasmanythrough-alternative-for-complex-joins)10 Jul 2026·3 min read 

### [Eloquent Custom Relations: Building a HasManyThrough Alternative for Complex Joins](https://msaied.com/articles/eloquent-custom-relations-building-a-hasmanythrough-alternative-for-complex-joins) 

 Laravel's built-in relations cover most schemas, but complex domains sometimes need a custom relation class. Learn to build one with proper eager loading, match callbacks, and whereHas support from scratch.

   [![](https://cdn.msaied.com/399/71a080bda5c9aa713a95cec2c8b42247.png)](https://msaied.com/articles/laravel-eloquent-global-scopes-bootable-traits-scope-removal-and-testing-pitfalls)9 Jul 2026·3 min read 

### [Laravel Eloquent Global Scopes: Bootable Traits, Scope Removal, and Testing Pitfalls](https://msaied.com/articles/laravel-eloquent-global-scopes-bootable-traits-scope-removal-and-testing-pitfalls) 

 Global scopes silently shape every query on a model. Learn how to write bootable trait scopes, safely remove them in specific contexts, and avoid the testing traps that make CI suites lie to you.

   [![](https://cdn.msaied.com/373/a6b1671af111801768bc65898128a6e4.png)](https://msaied.com/articles/postgresql-partial-and-covering-indexes-in-laravel-migrations-and-query-plans)6 Jul 2026·4 min read 

### [PostgreSQL Partial and Covering Indexes in Laravel Migrations and Query Plans](https://msaied.com/articles/postgresql-partial-and-covering-indexes-in-laravel-migrations-and-query-plans) 

 Learn how to define partial and covering indexes in Laravel migrations, read EXPLAIN ANALYZE output, and write Eloquent queries that actually use them — with concrete examples.

   [← Newer](https://msaied.com/articles?search=eloquent&page=6)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
8. [8](https://msaied.com/articles?search=eloquent&page=8)
9. [9](https://msaied.com/articles?search=eloquent&page=9)
10. [10](https://msaied.com/articles?search=eloquent&page=10)
11. [11](https://msaied.com/articles?search=eloquent&page=11)
12. [12](https://msaied.com/articles?search=eloquent&page=12)

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

  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)
