PHPackages                             olegstan/laravel-rest - 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. olegstan/laravel-rest

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

olegstan/laravel-rest
=====================

Powerful REST for the Laravel framework.

1.1.53(3y ago)01.1kMITPHPPHP &gt;=5.5.9

Since Jan 27Pushed 4d ago1 watchersCompare

[ Source](https://github.com/olegstan/laravel-rest)[ Packagist](https://packagist.org/packages/olegstan/laravel-rest)[ Docs](https://github.com/olegstan/laravel-rest)[ RSS](/packages/olegstan-laravel-rest/feed)WikiDiscussions main Synced today

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

`olegstan/laravel-rest` Package Documentation
=============================================

[](#olegstanlaravel-rest-package-documentation)

Overview
--------

[](#overview)

The `olegstan/laravel-rest` package offers a streamlined approach to building RESTful APIs with Laravel, emphasizing convention over configuration. It automatically sets up API routes and organizes the application structure to enhance the development of REST APIs. This document guides you through the installation, setup, and basic usage of the package.

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

[](#installation)

Begin by installing the package through Composer:

```
composer require olegstan/laravel-rest
```

This command adds the `olegstan/laravel-rest` package to your project, enabling its features and functionalities.

Associated Package
------------------

[](#associated-package)

For optimal use of `olegstan/laravel-rest`, install the related `laravel-request` package, which complements the main package by handling request validations and more. Find it at:

```
https://github.com/olegstan/laravel-request

```

Configuration
-------------

[](#configuration)

After installation, publish the package's assets and configurations to your project:

```
php artisan vendor:publish --provider="LaravelRest\LaravelRestServiceProvider"
```

This command copies necessary files into your project, setting the stage for the API's structure and behavior.

Automatic API Routing
---------------------

[](#automatic-api-routing)

With the package published, API routes are automatically configured. The routing convention follows the pattern:

```
/api/v1/call/{controllerName}/{functionName}

```

This pattern facilitates direct access to controller methods via API endpoints. For instance, to access the `postStore` method in `ClientController`, you would use:

- **URL:** `/api/v1/call/client/store`
- **Method:** POST

Project Structure
-----------------

[](#project-structure)

The package organizes your Laravel project in a manner conducive to API development, as follows:

```
/App
    /Api
        /Controllers
            /Common - Controllers without authentication requirements
            /AnyRole - Controllers for specific role-based access
        /Helpers - Utility functions and classes
        /Requests - Custom request validation classes
        /Transformers
            /Base - Common data transformers
            /AnyRole - Role-specific data transformers

```

### Controllers and Requests

[](#controllers-and-requests)

Example request handling:

```
const form = new FormData();
form.append('data[user_id]', 10);
form.append('data[first_name]', 'Andrey');
form.append('data[last_name]', 'Kirov');

const requestOptions = {
  method: "POST",
  body: form
};

let url = SERVER_API + '/api/v1/call/client/store';

await fetch(url, requestOptions)
  .then(response => response.json())
  .then(json => { /* Handle the JSON response */ })
  .catch(error => { /* Handle errors */ });
```

### Handling Data in Controllers

[](#handling-data-in-controllers)

Data sent to an endpoint, such as in the example above, is easily retrievable in the controller:

```
class ClientController extends BaseController
{
    public function postStore(Request $request)
    {
        $userId = $request->input('user_id');
        $firstName = $request->input('first_name');
        $lastName = $request->input('last_name');

        // Implement your logic here

        return $this->response()->success();
    }
}
```

Support
-------

[](#support)

For questions or further assistance with the `olegstan/laravel-rest` package, please reach out to .

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance65

Regular maintenance activity

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.8% 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 ~156 days

Total

4

Last Release

1151d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6509570?v=4)[olegstan](/maintainers/olegstan)[@olegstan](https://github.com/olegstan)

---

Top Contributors

[![olegstan](https://avatars.githubusercontent.com/u/6509570?v=4)](https://github.com/olegstan "olegstan (132 commits)")[![deadinsidebabkasupsidedown](https://avatars.githubusercontent.com/u/80322475?v=4)](https://github.com/deadinsidebabkasupsidedown "deadinsidebabkasupsidedown (2 commits)")[![MasyaSmv](https://avatars.githubusercontent.com/u/61746307?v=4)](https://github.com/MasyaSmv "MasyaSmv (1 commits)")

---

Tags

laravelrest

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/olegstan-laravel-rest/health.svg)

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

###  Alternatives

[pusher/pusher-http-laravel

\[DEPRECATED\] A Pusher bridge for Laravel

404509.7k4](/packages/pusher-pusher-http-laravel)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)

PHPackages © 2026

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