PHPackages                             owowagency/laravel-resources - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. owowagency/laravel-resources

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

owowagency/laravel-resources
============================

A package to develop projects faster.

v3.2.5(1y ago)1112.0k↓80%1[2 issues](https://github.com/owowagency/laravel-resources/issues)[2 PRs](https://github.com/owowagency/laravel-resources/pulls)2MITPHPCI failing

Since Oct 30Pushed 1y ago2 watchersCompare

[ Source](https://github.com/owowagency/laravel-resources)[ Packagist](https://packagist.org/packages/owowagency/laravel-resources)[ RSS](/packages/owowagency-laravel-resources/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (9)Versions (46)Used By (2)

[![banner-dark](./assets/banner-dark.svg#gh-dark-mode-only)](./assets/banner-dark.svg#gh-dark-mode-only)[![banner-light](./assets/banner-light.svg#gh-light-mode-only)](./assets/banner-light.svg#gh-light-mode-only)

 [![](https://camo.githubusercontent.com/99c0afd5390266f7bbb0d37211dc7d289f5c77602f25763a93c4673750222ca5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f776f776167656e63792f6c61726176656c2d7265736f7572636573)](https://camo.githubusercontent.com/99c0afd5390266f7bbb0d37211dc7d289f5c77602f25763a93c4673750222ca5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f776f776167656e63792f6c61726176656c2d7265736f7572636573) [![](https://github.com/owowagency/laravel-resources/actions/workflows/test.yml/badge.svg)](https://github.com/owowagency/laravel-resources/actions/workflows/test.yml/badge.svg)

 Sick and tired of having to create the same controller over and over?
 Look no further! OWOW presents "Laravel Resources".
 A package that makes creating API endpoints feel like breeze.

📖 Table of contents
===================

[](#-table-of-contents)

1. [Installation](#%EF%B8%8F-installation)
2. [Usage](#-usage)
3. [Contributing](#-contributing)
4. [License](#-license)
5. [OWOW](#owow)

⚙️ Installation
===============

[](#️-installation)

```
composer require owowagency/laravel-resources
```

🛠 Usage
=======

[](#-usage)

This package adds a few new features to the already existing `apiResource` method, `model` and `requests`.

`model` will be used to determine what model is being be handled.
`requests` should contain the form requests that are used to validate incoming data during creation and updating.

Route registration
------------------

[](#route-registration)

```
use App\Http\Requests\Posts\StoreRequest;
use App\Http\Requests\Posts\UpdateRequest;
use App\Models\Post;
use OwowAgency\LaravelResources\Controllers\ResourceController;

Route:apiResource(
    'posts',
    ResourceController::class,
    [
        'model' => Post::class,
        'requests' => [
            'store' => StoreRequest::class,
            'update' => UpdateRequest::class,
        ],
    ],
);
```

Customizing controllers
-----------------------

[](#customizing-controllers)

All methods in the [`ResourceController`](https://github.com/owowagency/laravel-resources/blob/master/src/Controllers/ResourceController.php) can be overwritten. We made it a little easier by adding methods like `indexModel`, and `updateModel`. You will not have to worry about validating, authorization, or returning the models as response.

```
use OwowAgency\LaravelResources\Controllers\ResourceController;

class PostController extends ResourceController
{
    /**
     * Returns models instances used for the index action.
     *
     * @return mixed
     */
    public function indexModel()
    {
        return Post::where('title', 'LIKE', request('search'))->paginate();
    }

    /**
     * Updates and returns the model instance for the update action.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Illuminate\Database\Eloquent\Model  $model
     * @return void
     */
    public function updateModel(Request $request, Model $model)
    {
        $model->update(['user_id' => \Auth::user()->id]);
    }
}
```

Eloquent API resources
----------------------

[](#eloquent-api-resources)

This package will always try to return the API resource representation of the specified model. It applies auto discovery to determine what resource to use.

By default it will use the following pattern to discover the resource class:

```
App\Http\Resources\{class_baseName($modelClass)}Resource

```

In case of a `Post` model that will become:

```
App\Http\Resources\PostResource

```

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

[](#configuration)

Configuration can be published with:

```
php artisan vendor:publish --tag=laravelresources
```

```
return [

    /**
     * Is used for auto discovery of http resources. Allows for placing
     * resources under a different namespace.
     */
    'resource_namespace' => 'App\\Http\\Resources',

    /**
     * Configure resources that do not follow the default auto discovery rules.
     *
     * Eg:
     * [Post::class => SpecialPostResource::class]
     */
    'resource_factory' => [],

];
```

🫶 Contributing
==============

[](#-contributing)

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

📜 License
=========

[](#-license)

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

[![](https://user-images.githubusercontent.com/45201651/176249441-e83226be-7281-4ddb-ad4a-9100f8862d4e.svg#gh-light-mode-only)](https://user-images.githubusercontent.com/45201651/176249441-e83226be-7281-4ddb-ad4a-9100f8862d4e.svg#gh-light-mode-only)

[![](https://user-images.githubusercontent.com/45201651/176249444-ceede6f9-3c2e-481d-87c3-3a72ca497e65.svg#gh-dark-mode-only)](https://user-images.githubusercontent.com/45201651/176249444-ceede6f9-3c2e-481d-87c3-3a72ca497e65.svg#gh-dark-mode-only)

This package has been brought to you with much love by the wizkids of [OWOW](https://owow.io/). Do you like this package? We’re still looking for new talent and Wizkids. So do you want to contribute to open source, while getting paid? [Apply now](https://owow.io/careers)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 59.5% 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 ~54 days

Recently: every ~178 days

Total

43

Last Release

462d ago

Major Versions

1.2.9 → 2.0.02019-10-07

2.4.3 → 3.0.02020-10-01

2.4.4 → 3.0.12020-10-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b0064d818f9593dfb4f9d86217bbf5f14961ad6779b84fd5546dd91f296d898?d=identicon)[dees040](/maintainers/dees040)

---

Top Contributors

[![thomasowow](https://avatars.githubusercontent.com/u/45201651?v=4)](https://github.com/thomasowow "thomasowow (66 commits)")[![dees040](https://avatars.githubusercontent.com/u/5390555?v=4)](https://github.com/dees040 "dees040 (24 commits)")[![thomas-veen](https://avatars.githubusercontent.com/u/8861831?v=4)](https://github.com/thomas-veen "thomas-veen (8 commits)")[![mindabartosz](https://avatars.githubusercontent.com/u/58559977?v=4)](https://github.com/mindabartosz "mindabartosz (7 commits)")[![Yasaie](https://avatars.githubusercontent.com/u/49386067?v=4)](https://github.com/Yasaie "Yasaie (3 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![YouneselBarnoussi](https://avatars.githubusercontent.com/u/16510310?v=4)](https://github.com/YouneselBarnoussi "YouneselBarnoussi (1 commits)")

---

Tags

laravelresources

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/owowagency-laravel-resources/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[erag/laravel-pwa

A simple and easy-to-use PWA (Progressive Web App) package for Laravel applications.

16083.3k](/packages/erag-laravel-pwa)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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