/JustHttpStatusCodes

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 ๐Ÿš€

Primary LanguagePHPMIT LicenseMIT

Just HTTP Status Codes

Just HTTP Status Codes is a great way to empower your project with clean practice ๐Ÿ’ซ

๐Ÿ“„ Overview

Ko Fi - Offer Me A Coffee

Simplest. Clean. Efficient. Just what your project needs ๐Ÿงน

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 and boost the software development at the same time! ๐Ÿ’ช

@phenrysay pH-7

โš–๏ธ License

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