PHPackages                             nickjbedford/laravel-endpoints - 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. nickjbedford/laravel-endpoints

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

nickjbedford/laravel-endpoints
==============================

The Laravel Endpoints framework provides an easy way to implement API endpoints in separate Responsable-style classes.

0.3.1(2y ago)185MITPHPPHP ^8.2

Since May 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nickjbedford/laravel-endpoints)[ Packagist](https://packagist.org/packages/nickjbedford/laravel-endpoints)[ RSS](/packages/nickjbedford-laravel-endpoints/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (7)Dependencies (4)Versions (12)Used By (0)

Laravel Endpoints
=================

[](#laravel-endpoints)

The Laravel Endpoints framework provides an easy way to implement API endpoints in separate classes that are then registered automatically based on the properties defined in each endpoint subclass.

To create an endpoint, extend the `YetAnother\Laravel\Endpoint` abstract class, defining whether to include the GET, POST, UPDATE or DELETE route methods. You must also specify the URI of the route as well as the route prefix for all automatically registered routes.

The `Endpoint` base class provides convenient methods to return JSON success, failure and exception response in a standard structure according to the [nickjbedford/json-response-laravel](https://github.com/nickjbedford/json-response-laravel) package.

```
class UsersEndpoint extends YetAnother\Laravel\Endpoint
{
    // Specify the URI of the endpoint.
    protected string $uri = '/users';

    // Specify the route prefix for the endpoint methods.
    // The suffixes are get, post, update and delete.
    protected string $routePrefix = 'users.';

    // Register the following methods when set to true.
    protected bool $get = true;
    protected bool $post = true;
    protected bool $update = true;
    protected bool $delete = true;

    /**
     * Override the GET method.
     * @param Request $request
     * @return Response
     */
    function get(Request $request): Response
    {
        $users = /* fetch user(s) */;
        return $this->success($users);
    }

    /**
     * Override the POST method.
     * @param Request $request
     * @return Response
     */
    function post(Request $request): Response
    {
        $user = /* create new user */;
        return $this->success($user);
    }

    /**
     * Override the PATCH method.
     * @param Request $request
     * @return Response
     */
    function update(Request $request): Response
    {
        $user = /** fetch and update user */
        return $this->success(self::UpdateResponse);
    }

    /**
     * Override the DELETE method.
     * @param Request $request
     * @return Response
     */
    function delete(Request $request): Response
    {
        /** fetch and delete user */
        return $this->success(self::DeleteResponse);
    }
}
```

Registering Endpoints
---------------------

[](#registering-endpoints)

### Manual Registration

[](#manual-registration)

The `Endpoint` base class includes the `register()` method for automatically registering the endpoint's routes. Simply call `$endpoint->register()`on all of your endpoint subclass instances to register them.

### Service Provider Registration

[](#service-provider-registration)

This package also includes the `YetAnother\Laravel\EndpointServiceProvider`service provider class that can be used alongside a `config/endpoints.php`configuration file.

#### \[config/app.php\]

[](#configappphp)

Add the `YetAnother\Laravel\EndpointServiceProvider::class` entry to the array of `'providers'` in the `config/app.php` configuration file.

```
    // ...

    'providers' => [
        // ...

        YetAnother\Laravel\EndpointServiceProvider::class
    ],

    // ...
```

### \[config/endpoints.php\]

[](#configendpointsphp)

Create a PHP file in the config directory called endpoints.php and have it return an array of endpoint class names from your codebase.

```
    return [
        MyEndpoint::class,
        MyOtherEndpoint::class
    ];
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~91 days

Recently: every ~120 days

Total

10

Last Release

1002d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.4

0.3.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/8bce7dd852d725a53d2d7a81183acc952c7902242b8fcfa4b45564fe1702d8f3?d=identicon)[nickjbedford](/maintainers/nickjbedford)

---

Top Contributors

[![nickjbedford](https://avatars.githubusercontent.com/u/10795658?v=4)](https://github.com/nickjbedford "nickjbedford (1 commits)")

---

Tags

jsonapirest

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nickjbedford-laravel-endpoints/health.svg)

```
[![Health](https://phpackages.com/badges/nickjbedford-laravel-endpoints/health.svg)](https://phpackages.com/packages/nickjbedford-laravel-endpoints)
```

###  Alternatives

[marcin-orlowski/laravel-api-response-builder

Helps building nice, normalized and easy to consume Laravel REST API.

837458.6k3](/packages/marcin-orlowski-laravel-api-response-builder)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69114.3k](/packages/serpapi-google-search-results-php)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[guanguans/laravel-api-response

Normalize and standardize Laravel API response data structure. - 规范化和标准化 Laravel API 响应数据结构。

485.6k](/packages/guanguans-laravel-api-response)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[jsor/hal-client

A lightweight client for consuming and manipulating Hypertext Application Language (HAL) resources.

2425.9k1](/packages/jsor-hal-client)

PHPackages © 2026

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