From 98a3704b68793453f5ad5aead18e3e8b6f4ba0b8 Mon Sep 17 00:00:00 2001 From: Razin Shaikh Date: Tue, 28 Oct 2025 09:59:33 +0530 Subject: [PATCH 1/2] Fix typos and update README structure Corrected typos and updated section numbering in README. --- README.md | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 4d244a6..baa6fa7 100644 --- a/README.md +++ b/README.md @@ -478,12 +478,11 @@ Let's dive deeper into the Laravel request lifecycle. require __DIR__.'/../vendor/autoload.php'; ``` - - Quest travels through the `Bootstrap` layer and lands in the `Kernel`. However, `Middleware` is not yet applied. + - Request travels through the `Bootstrap` layer and lands in the `Kernel`. However, `Middleware` is not yet applied. 2. **HTTP Kernel**: -
- + - Laravel trusts the HTTP Kernel with assigning \textbf{global middleware}. - `App\Http\Kernel` houses both the global middleware and approach to invoking route middleware. - Using `\Illuminate\Foundation\Http\Kernel`, the quest arrives at the `\Illuminate\Foundation\Application`. @@ -494,7 +493,7 @@ Let's dive deeper into the Laravel request lifecycle. \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, // More global middleware go here ]; - ``` + ``` 3. **Routing**: @@ -514,8 +513,7 @@ Let's dive deeper into the Laravel request lifecycle. ``` 4. **Controller**: -
- + - The route delegates the quest to an assigned controller together. The method on the controller then processes the quest. - If applicable, **the controller method returns a response**. Laravel, naturally, transforms this into an HTTP response. @@ -527,7 +525,7 @@ Let's dive deeper into the Laravel request lifecycle. } ``` -5. **Response**: +6. **Response**: - The created response passes through \textbf{middleware} once again, if there might exist any. - Lastly, Laravel sends the response back to the customer. @@ -689,18 +687,6 @@ class Phone extends Model } } ``` - -### Best Practices for Eloquent - -1. **Mind the N+1 Problem**: Use eager loading to minimize the number of queries to the database. - -2. **Keep It Consistent**: Abide by Laravel's conventions to ensure smooth sailing. - -3. **Fail Early**: Utilize strict type casting and validation to catch issues at the earliest opportunity. - -4. **Stay Efficient**: Make your queries as efficient as possible by utilizing the many optimizing features of Eloquent. - -5. **Test Thoroughly**: Always validate your model's methods and relationships to ensure they perform as expected.
## 10. How does one perform _validations_ in _Laravel_? From 360a83cf206a248d24795cf98906e5d42ea4b387 Mon Sep 17 00:00:00 2001 From: Razin Shaikh Date: Tue, 28 Oct 2025 10:02:22 +0530 Subject: [PATCH 2/2] Fix response section numbering in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index baa6fa7..1cf8aed 100644 --- a/README.md +++ b/README.md @@ -525,7 +525,7 @@ Let's dive deeper into the Laravel request lifecycle. } ``` -6. **Response**: +5. **Response**: - The created response passes through \textbf{middleware} once again, if there might exist any. - Lastly, Laravel sends the response back to the customer.