PHPackages                             davidhoeck/lararest - 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. [Database &amp; ORM](/categories/database)
4. /
5. davidhoeck/lararest

ActiveLibrary[Database &amp; ORM](/categories/database)

davidhoeck/lararest
===================

The simplest way to create CRUD REST API routes.

1.2.0(9y ago)020MITPHPPHP &gt;=5.6.4

Since Mar 17Pushed 9y agoCompare

[ Source](https://github.com/davidhoeck/LaraRest)[ Packagist](https://packagist.org/packages/davidhoeck/lararest)[ RSS](/packages/davidhoeck-lararest/feed)WikiDiscussions master Synced yesterday

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

LaraRest
========

[](#lararest)

[![Latest Stable Version](https://camo.githubusercontent.com/fae248915946550863d99e68ae77409dbd60001b3db6fa77c3bb228cde44ada4/68747470733a2f2f706f7365722e707567782e6f72672f6461766964686f65636b2f6c617261726573742f762f737461626c65)](https://packagist.org/packages/davidhoeck/lararest)[![License](https://camo.githubusercontent.com/71a7a184fb552fd1070fee4dc33136c66782d7531e9fbe22ce0aab45aee5080e/68747470733a2f2f706f7365722e707567782e6f72672f6461766964686f65636b2f6c617261726573742f6c6963656e7365)](https://packagist.org/packages/davidhoeck/lararest)[![Latest Unstable Version](https://camo.githubusercontent.com/715a690caf7439e18fbb3d32f72e50ec309ac0ee96cdef01af11eb9c5590bf85/68747470733a2f2f706f7365722e707567782e6f72672f6461766964686f65636b2f6c617261726573742f762f756e737461626c65)](https://packagist.org/packages/davidhoeck/lararest)

Keep your API routes file clean and generate your CRUD routes via LaraRest.

STEP 1
------

[](#step-1)

Install LaraRest via Composer.

```
composer require davidhoeck/lararest

```

STEP 2
------

[](#step-2)

Create your eloquent models.

STEP 3
------

[](#step-3)

Go to your `api.php` in the `routes` folder.

STEP 4
------

[](#step-4)

Initialize the `RestApiProvider`. Just paste the following lines of code, at the top of your `api.php` file.

```
/** @var \DavidHoeck\LaraRest\RestApiProvider $apiProvider */
$apiProvider = new \DavidHoeck\LaraRest\RestApiProvider();

```

STEP 5
------

[](#step-5)

Hook your models into the provider. Add every model your want your CRUD REST routes to be generate.

```
$apiProvider->addModel( new User() );

```

EXAMPLE
-------

[](#example)

The following line of code ...

```
$apiProvider->addModel( new User() );

```

... produces these routes.

MethodURINameActionMiddlewareGETapi/usersapi.users.indexApp\\Http\\Controllers\\UserController@indexapiDELETEapi/usersapi.users.createApp\\Http\\Controllers\\UserController@createapiGETapi/users/paginateapi.users.paginateApp\\Http\\Controllers\\UserController@paginateapiGETapi/users/{id}api.users.findApp\\Http\\Controllers\\UserController@findapiPUTapi/users/{id}api.users.updateApp\\Http\\Controllers\\UserController@updateapiDELETEapi/users/{id}api.users.deleteApp\\Http\\Controllers\\UserController@deleteapi

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity62

Established project with proven stability

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 ~1 days

Total

5

Last Release

3386d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/030c2d1619e640448247b08443490f72492b38e1e9b3f2cbc3257c4dc4641375?d=identicon)[davidhoeck](/maintainers/davidhoeck)

---

Tags

eloquentlaravellaravel-5-packagerest-api

### Embed Badge

![Health badge](/badges/davidhoeck-lararest/health.svg)

```
[![Health](https://phpackages.com/badges/davidhoeck-lararest/health.svg)](https://phpackages.com/packages/davidhoeck-lararest)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11222.5M33](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[mozex/laravel-scout-bulk-actions

Import, flush, and queue-import all your Laravel Scout searchable models at once. Auto-discovers models, runs in bulk, tracks progress.

1437.7k](/packages/mozex-laravel-scout-bulk-actions)[ramadan/easy-model

A Laravel package for enjoyably managing database queries.

111.6k](/packages/ramadan-easy-model)

PHPackages © 2026

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