PHPackages                             egbosionu/lara-http-enums - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. egbosionu/lara-http-enums

ActiveLibrary[HTTP &amp; Networking](/categories/http)

egbosionu/lara-http-enums
=========================

A collection of HTTP-related PHP enums for Laravel applications

v1.0.0(1y ago)02MITPHPPHP ^8.1

Since Feb 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kazburrel/lara-http-enums)[ Packagist](https://packagist.org/packages/egbosionu/lara-http-enums)[ RSS](/packages/egbosionu-lara-http-enums/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

LaraHttpEnums
=============

[](#larahttpenums)

**A Laravel package for managing HTTP status codes, methods and other related HTTP enums.**

Description
-----------

[](#description)

LaraHttpEnums is a simple, easy-to-use package that provides a collection of HTTP status codes, methods and related enums to be used in your Laravel projects. This package helps streamline working with HTTP-related constants, improving readability and consistency in your code.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require egbosionu/lara-http-enums

```

### Usage

[](#usage)

### HTTP Status Codes

[](#http-status-codes)

```
    use Egbosionu\LaraHttpEnums\StatusCode;

    // Basic usage
    $status = StatusCode::OK; // 200

    $status = StatusCode::NOT_FOUND; // 404

    // Get reason phrase
    $phrase = StatusCode::OK->getReasonPhrase(); // "OK"

    // Check status type
    $status = StatusCode::NOT_FOUND;

    $status->isClientError(); // true

    $status->isError(); // true

    $status->isSuccessful(); // false

    // Convert from integer
    $status = StatusCode::fromInt(404); // StatusCode::NOT_FOUND

    $status = StatusCode::tryFromInt(404); // StatusCode::NOT_FOUND or null if invalid

    // Convert from name
    $status = StatusCode::fromName('NOT_FOUND'); // StatusCode::NOT_FOUND

    $status = StatusCode::tryFromName('NOT_FOUND'); // StatusCode::NOT_FOUND or null if invalid
```

### HTTP Methods

[](#http-methods)

```
    use Egbosionu\LaraHttpEnums\Method;

    // Basic usage
    $method = Method::GET;

    $method = Method::POST;

    // Check method properties
    $method = Method::GET;

    $method->isSafe(); // true - doesn't modify resources

    $method->isIdempotent(); // true - multiple identical requests have same effect as single request

    // Convert from string
    $method = Method::fromName('GET'); // Method::GET

    $method = Method::tryFromName('GET'); // Method::GET or null if invalid
```

### Reason Phrases

[](#reason-phrases)

```
    use Egbosionu\LaraHttpEnums\ReasonPhrase;
    use Egbosionu\LaraHttpEnums\StatusCode;

    // Get reason phrase from status code
    $phrase = ReasonPhrase::fromStatusCode(StatusCode::NOT_FOUND); // ReasonPhrase::NOT_FOUND

    $text = ReasonPhrase::fromStatusCode(StatusCode::NOT_FOUND)->value; // "Not Found"

    // Try to get reason phrase
    $phrase = ReasonPhrase::tryFromStatusCode(StatusCode::NOT_FOUND); // ReasonPhrase::NOT_FOUND or null if invalid
```

### Features

[](#features)

1. Type-safe HTTP status codes with integer values
2. Type-safe HTTP methods with string values
3. Standard reason phrases for all status codes
4. Helper methods for checking status code categories
5. Helper methods for checking method properties
6. Case-insensitive method name parsing
7. Null-safe conversion methods
8. Full PSR-4 autoloading support

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Obiora Egbosionu](https://github.com/kazburrel)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance43

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

462d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89668d0513309f97562d9c589604e03c3fdf88666b1c52ce0c98eb431faf954c?d=identicon)[kazburrel](/maintainers/kazburrel)

---

Top Contributors

[![kazburrel](https://avatars.githubusercontent.com/u/87763251?v=4)](https://github.com/kazburrel "kazburrel (22 commits)")

---

Tags

httplaravelstatus codesenumshttp-methods

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/egbosionu-lara-http-enums/health.svg)

```
[![Health](https://phpackages.com/badges/egbosionu-lara-http-enums/health.svg)](https://phpackages.com/packages/egbosionu-lara-http-enums)
```

###  Alternatives

[pusher/pusher-http-laravel

\[DEPRECATED\] A Pusher bridge for Laravel

400509.0k3](/packages/pusher-pusher-http-laravel)[kozz/laravel-guzzle-provider

Guzzle 5/6 Service Provider for Laravel

621.1M2](/packages/kozz-laravel-guzzle-provider)[matthewbdaly/laravel-etag-middleware

A Laravel middleware for adding ETags to HTTP requests to improve response times

64326.0k2](/packages/matthewbdaly-laravel-etag-middleware)[vinelab/http

An http library developed for the laravel framework. aliases itself as HttpClient

59300.2k11](/packages/vinelab-http)[laravel-shift/curl-converter

A command line tool to convert curl requests to Laravel HTTP requests.

935.3k](/packages/laravel-shift-curl-converter)[tomschlick/request-migrations

HTTP Request Migrations

1844.5k](/packages/tomschlick-request-migrations)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
