From 4b94feacfe4f9bbd5b0eba4d6f20bec6c06398d1 Mon Sep 17 00:00:00 2001 From: Rudiansyah Date: Thu, 7 Dec 2023 20:49:12 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs(laravel.md):=20update=20HTT?= =?UTF-8?q?P=20Exceptions=20section=20to=20include=20additional=20examples?= =?UTF-8?q?=20and=20improve=20readability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 💡 refactor(laravel.md): reformat code examples in the HTTP Exceptions section for better clarity and consistency --- source/_posts/laravel.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/source/_posts/laravel.md b/source/_posts/laravel.md index fcb7958..cedbbfb 100644 --- a/source/_posts/laravel.md +++ b/source/_posts/laravel.md @@ -471,11 +471,20 @@ public function isValid($value) ``` Report an exception but continue handling the current request - ### HTTP Exceptions - ```php - // page not found - abort(404); - ``` +### HTTP Exceptions +```php +// page not found +abort(404); + +// Unauthorized +abort(401); + +// Forbidden +abort(403); + +// Server Error +abort(500); +``` Generate an HTTP exception response using status code