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/532/0c1c122849d3f997950ffca44076f86c.png)](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-pain-1)10 Aug 2026·4 min read 

### [PostgreSQL JSONB in Laravel: Indexing, Querying, and Casting Without the Pain](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-pain-1) 

 JSONB columns unlock flexible schemas in PostgreSQL, but raw queries get ugly fast. Learn how to index, query, and cast JSONB in Laravel with clean Eloquent patterns that stay performant at scale.

   [![](https://cdn.msaied.com/539/74138a5313c0865164df1324379b1df5.png)](https://msaied.com/articles/laravel-discount-coupon-codes-usage-limits-and-stacking)9 Aug 2026·4 min read 

### [Laravel Discount: Coupon Codes, Usage Limits, and Stacking](https://msaied.com/articles/laravel-discount-coupon-codes-usage-limits-and-stacking) 

 Laravel Discount by Milwad Khosravi adds coupon codes, time windows, per-user usage limits, stackable discounts, and cart integration to any Laravel application through a single Eloquent-backed facade.

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

   [![](https://cdn.msaied.com/529/5d6560d5f6f0a2cdc483fbfecc24707d.png)](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-bloat-2)9 Aug 2026·4 min read 

### [PostgreSQL JSONB in Laravel: Indexing, Querying, and Casting Without the Bloat](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-bloat-2) 

 JSONB columns let you store flexible data without sacrificing query performance. Learn how to index, query, and cast JSONB in Laravel using real Eloquent patterns that stay fast at scale.

   [![](https://cdn.msaied.com/528/3c1e1dba1e2f4ca6b8686cf670dcd3b8.png)](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-bloat-1)9 Aug 2026·3 min read 

### [PostgreSQL JSONB in Laravel: Indexing, Querying, and Casting Without the Bloat](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-bloat-1) 

 JSONB columns give you schema flexibility without sacrificing query performance. Learn how to index, query, and cast JSONB data in Laravel using real Eloquent patterns and raw PostgreSQL power.

   [![](https://cdn.msaied.com/527/ccaba2b97bd9c80bd87c9e4886481cb6.png)](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-bloat)9 Aug 2026·4 min read 

### [PostgreSQL JSONB in Laravel: Indexing, Querying, and Casting Without the Bloat](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-bloat) 

 JSONB columns unlock flexible schemas without sacrificing query performance. Learn how to index, query, and cast PostgreSQL JSONB data in Laravel using real Eloquent patterns that stay fast at scale.

   [![](https://cdn.msaied.com/526/bc43aae3afe723f9a29f47820735edf5.png)](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-chaos-2)9 Aug 2026·3 min read 

### [PostgreSQL JSONB in Laravel: Indexing, Querying, and Casting Without the Chaos](https://msaied.com/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-chaos-2) 

 JSONB columns unlock flexible schemas, but without the right indexes and Eloquent integration they become a performance trap. Here is how to use them correctly in production Laravel apps.

   [![](https://cdn.msaied.com/523/a12bd8c82544aafcd6de50ff8c076141.png)](https://msaied.com/articles/eloquent-query-optimization-slaying-n1-problems-at-scale)8 Aug 2026·4 min read 

### [Eloquent Query Optimization: Slaying N+1 Problems at Scale](https://msaied.com/articles/eloquent-query-optimization-slaying-n1-problems-at-scale) 

 N+1 queries silently kill Laravel app performance. This guide digs into eager loading strategies, query deduplication, and Eloquent internals to help you write queries that stay fast as data grows.

   [![](https://cdn.msaied.com/506/7d5fcddaf6c26c87a749a20b8bdffbfa.png)](https://msaied.com/articles/postgresql-ctes-window-functions-and-lateral-joins-in-laravel-4)4 Aug 2026·1 min read 

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

 Go beyond basic Eloquent queries. Learn how to leverage PostgreSQL CTEs, window functions, and LATERAL joins directly from Laravel to solve real reporting and ranking problems cleanly.

   [![](https://cdn.msaied.com/496/a70ec2727a0239a23590ef1107e6af75.png)](https://msaied.com/articles/laravel-eloquent-global-vs-local-scopes-pitfalls-ordering-and-scope-composition)1 Aug 2026·4 min read 

### [Laravel Eloquent Global vs Local Scopes: Pitfalls, Ordering, and Scope Composition](https://msaied.com/articles/laravel-eloquent-global-vs-local-scopes-pitfalls-ordering-and-scope-composition) 

 Global and local scopes look simple until they compose unexpectedly. This deep dive covers scope ordering, soft-delete conflicts, scope removal, and safe patterns for building composable query constraints in production Laravel apps.

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

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

  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)
