Skip to content

The Simplest & Cleanest HTTP Status Codes for PHP. All PHP HTTP Status Codes are stored into beautiful constant names 🎨 Ideal when you develop an API that involves various HTTP codes πŸš€

License

Notifications You must be signed in to change notification settings

pH-7/JustHttpStatusCodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

89 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Just HTTP Status Codes

Empowers your projects with elegant clean practices πŸ’«

πŸ“„ Overview

Simplest. Clean. Efficient. Just what your project needs 🧹

Ko Fi - Offer Me A Coffee

Don't hardcode HTTP status codes. Magic numbers (hard-coded numbers) make your code hard to read and understood.

When you have all status codes are stored in readable constants, it makes the development of your application so easy and enjoyable.

It prevents you from using the wrong HTTP status code and saves time and energy when developing an API that involves various HTTP status codes to be sent.

PHP HTTP Status Codes constants

🐘 PHP Requirement

PHP v7.3 or newer πŸš€

πŸ›  Installation

composer require ph-7/just-http-status-codes

If you don't already use composer in your project, include Composer's autoload as below in the main index file, bootstrap or in another file that is always included in all pages.

require __DIR__ . '/vendor/autoload.php';

πŸ₯³ Usage

Just use the beautiful HTTP status code you need.

Like below πŸ‘‡

use PH7\JustHttp\StatusCode;


StatusCode::OK; // This is 200

StatusCode::CREATED; // 201 code

StatusCode::NOT_FOUND; // 404

StatusCode::INTERNAL_SERVER_ERROR; // 500

πŸ’ͺ Building this library, together! πŸš€

Watch the video

πŸ‘‰ Click here to watch on YouTube

πŸ§‘β€πŸ³ Who made this...?

Pierre-Henry Soria

Pierre-Henry Soria, a highly passionate, zen & pragmatic software engineer 😊

οΈβ˜•οΈ Are you enjoying it? Offer me a coffee (what's your favorite coffee? Mine is almond flat white πŸ˜‹)

@phenrysay pH-7 YouTube Tech Videos

βš–οΈ License

Just HTTP StatusCodes is generously distributed under the MIT πŸŽ‰ Enjoy!