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/203/54c43da0c2e5005ca99e4bee1b905e6f.png)](https://msaied.com/articles/laravel-enums-as-first-class-citizens-casts-rules-and-eloquent-integration)16 Jun 2026·1 min read 

### [Laravel Enums as First-Class Citizens: Casts, Rules, and Eloquent Integration](https://msaied.com/articles/laravel-enums-as-first-class-citizens-casts-rules-and-eloquent-integration) 

 PHP 8.1 backed enums unlock type-safe domain modelling in Laravel. Learn how to cast them, validate them, use them in query scopes, and avoid the common pitfalls that leak primitive strings into your domain.

   [![](https://cdn.msaied.com/201/4de012f75c1e4a61467844d2babacdfb.png)](https://msaied.com/articles/eloquent-query-scopes-as-first-class-objects-reusable-testable-and-composable)15 Jun 2026·1 min read 

### [Eloquent Query Scopes as First-Class Objects: Reusable, Testable, and Composable](https://msaied.com/articles/eloquent-query-scopes-as-first-class-objects-reusable-testable-and-composable) 

 Move beyond inline where() chains by encapsulating query logic in dedicated scope classes. Learn how to build composable, testable Eloquent scopes that keep your repositories and controllers clean.

   [![](https://cdn.msaied.com/176/e761e34c4eeac562198091ba035908ca.png)](https://msaied.com/articles/recursive-queries-in-mysql-8-with-laravel-ctes-hierarchies-and-adjacency-lists)14 Jun 2026·2 min read 

### [Recursive Queries in MySQL 8 with Laravel: CTEs, Hierarchies, and Adjacency Lists](https://msaied.com/articles/recursive-queries-in-mysql-8-with-laravel-ctes-hierarchies-and-adjacency-lists) 

 MySQL 8 supports recursive CTEs. Learn how to query adjacency-list hierarchies in Laravel without pulling the whole table into PHP, using raw expressions, query macros, and Eloquent integration.

   [![](https://cdn.msaied.com/175/8e5685c14467b502c2bcbd62b4f47f64.png)](https://msaied.com/articles/postgresql-ctes-window-functions-and-lateral-joins-in-laravel)14 Jun 2026·4 min read 

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

 Go beyond basic Eloquent queries: learn how to harness PostgreSQL CTEs, window functions, and LATERAL joins directly from Laravel using raw expressions and query builder macros.

   [![](https://cdn.msaied.com/174/2c75896ee4182bb2f66e2c93bed18796.png)](https://msaied.com/articles/eloquent-custom-casts-encapsulating-value-objects-without-the-bloat)14 Jun 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) 

 Custom Eloquent casts let you bind rich value objects directly to model attributes. This article shows how to build clean, testable casts that enforce domain rules at the boundary between your database and PHP.

   [![](https://cdn.msaied.com/165/4de273593ea2005169698edc5cc53d6b.png)](https://msaied.com/articles/filament-v3-global-search-custom-result-providers-and-scoped-tenant-isolation)14 Jun 2026·1 min read 

### [Filament v3 Global Search: Custom Result Providers and Scoped Tenant Isolation](https://msaied.com/articles/filament-v3-global-search-custom-result-providers-and-scoped-tenant-isolation) 

 Learn how to register custom global search providers in Filament v3, scope results to the current tenant, and surface non-Eloquent data — all without touching core internals.

   [![](https://cdn.msaied.com/160/89eca7b3d4a7f19692354a7621a64bb3.png)](https://msaied.com/articles/optimizing-eloquent-queries-beyond-n1-with-withexists-and-withcount)14 Jun 2026·4 min read 

### [Optimizing Eloquent Queries: Beyond N+1 with `withExists` and `withCount`](https://msaied.com/articles/optimizing-eloquent-queries-beyond-n1-with-withexists-and-withcount) 

 N+1 query issues are a common performance bottleneck in Laravel applications. While `with()` is the go-to solution for eager loading relationships, many developers overlook the power of `withExists()` and `withCount()` for specific scenarios. This article dives into practical applications of these lesser-used Eloquent methods to significantly reduce query load and improve application responsiveness, especially when dealing with conditional rendering or aggregate data.

   [![](https://cdn.msaied.com/29/01KT7MCCMPZQ59D2E4B5H01G2A.jpg)](https://msaied.com/articles/notable-a-laravel-notes-package-for-eloquent)3 Jun 2026·2 min read 

### [Notable: A Laravel Notes Package for Eloquent](https://msaied.com/articles/notable-a-laravel-notes-package-for-eloquent) 

 Notable empowers Laravel apps to attach notes to any Eloquent model using polymorphic relationships. It ships with a trait, migrations, and a developer-friendly API.

 [Laravel](https://msaied.com/articles?category=laravel) [Composer Pacakge](https://msaied.com/articles?category=composer-pacakge) 

   [![](https://cdn.msaied.com/114/2214aaa98d581cc58d287c9253cc09eb.png)](https://msaied.com/articles/php-attributes-in-laravel-13-a-comprehensive-guide)18 Mar 2026·3 min read 

### [PHP Attributes in Laravel 13: A Comprehensive Guide](https://msaied.com/articles/php-attributes-in-laravel-13-a-comprehensive-guide) 

 Explore the new PHP Attributes in Laravel 13, transforming Eloquent models, queue jobs, and more. Learn how to leverage these declarative features with practical examples.

 [Laravel](https://msaied.com/articles?category=laravel) 

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

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

  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)
