PHPackages                             timwassenburg/laravel-improved-resource-controllers - 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. [CLI &amp; Console](/categories/cli)
4. /
5. timwassenburg/laravel-improved-resource-controllers

ActiveLibrary[CLI &amp; Console](/categories/cli)

timwassenburg/laravel-improved-resource-controllers
===================================================

Generate complete resource controllers

v1.0.4(4y ago)474[2 PRs](https://github.com/timwassenburg/laravel-improved-resource-controllers/pulls)MITPHP

Since Aug 30Pushed 1y ago2 watchersCompare

[ Source](https://github.com/timwassenburg/laravel-improved-resource-controllers)[ Packagist](https://packagist.org/packages/timwassenburg/laravel-improved-resource-controllers)[ Docs](https://github.com/timwassenburg/laravel-improved-resource-controllers)[ RSS](/packages/timwassenburg-laravel-improved-resource-controllers/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (2)Versions (8)Used By (0)

[![Logo](img/banner.png)](img/banner.png)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1c191678b725da7b6d49c4bd4203fdab298a7d6b22f8abb3f217312d5659af89/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74696d77617373656e627572672f6c61726176656c2d696d70726f7665642d7265736f757263652d636f6e74726f6c6c6572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/timwassenburg/laravel-improved-resource-controllers)[![Total Downloads](https://camo.githubusercontent.com/4a4705831302d27b2ab9e3cb65b3651abe8ed7c21ff98380df0245f2a87bbc8d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74696d77617373656e627572672f6c61726176656c2d696d70726f7665642d7265736f757263652d636f6e74726f6c6c6572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/timwassenburg/laravel-improved-resource-controllers)[![License](https://camo.githubusercontent.com/91af3375b9941edfe2ddc12370ed084db8ddc0e2d86b0b76ad8b1b2d26f2d127/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74696d77617373656e627572672f6c61726176656c2d696d70726f7665642d7265736f757263652d636f6e74726f6c6c657273)](https://packagist.org/packages/timwassenburg/laravel-improved-resource-controllers)

---

Table of Contents
-----------------

[](#table-of-contents)

1. [Features](#features)
2. [Getting started](#getting-started)
    - [Installation](#installation)
    - [Publish config (optional)](#publish-config-(optional))
    - [Publish stubs (optional)](#publish-stubs-(optional))
3. [Usage](#usage)
    - [Default resource controller](#default-resource-controller)
    - [Default API resource controller](#default-api-resource-controller)
    - [Model resource controller](#model-resource-controller)
    - [Model API resource controller](#model-api-resource-controller)
    - [Nested resource controller](#nested-resource-controller)
    - [Nested API resource controller](#nested-api-resource-controller)
4. [Variables](#variables)
    - [General](#general)
    - [With parent (--parent=Customer)](#with-parent-(--parent=customer))
5. [More generator packages](#more-generator-packages)
6. [Contributing](#contributing)
7. [License](#license)

Features
--------

[](#features)

This simple package extends the `php artisan make:controller` command and generates resource controllers with working resource functions out of the box to prevent you from writing the same basic controller functions over and over again. Keep in mind the improved resource controllers are only meant as a starting point. You still have to add your own routes, validation, migrations, etc.

Getting started
---------------

[](#getting-started)

### Installation

[](#installation)

Require the package with composer.

```
composer require timwassenburg/laravel-improved-resource-controllers --dev
```

### Publish config (optional)

[](#publish-config-optional)

```
php artisan vendor:publish --provider="TimWassenburg\ImprovedResourceControllers\ImprovedResourceControllersServiceProvider" --tag="config"
```

### Publish stubs (optional)

[](#publish-stubs-optional)

To change the generated resource controllers you can override the stubs and adjust it to your liking. The stubs will be stored in /resources/stubs.

```
php artisan vendor:publish --provider="TimWassenburg\ImprovedResourceControllers\ImprovedResourceControllersServiceProvider" --tag="stubs"
```

Usage
-----

[](#usage)

The idea behind this package is that you can keep using the make:controller commands you are already used to. So no need to change your muscle memory. Checkout the example output to see the result for each command.

### Default resource controller

[](#default-resource-controller)

```
php artisan make:controller CustomerController --resource
```

[Example output](https://github.com/timwassenburg/laravel-improved-resource-controllers/tree/master/examples/DefaultResourceController.php)

### Default API resource controller

[](#default-api-resource-controller)

```
php artisan make:controller CustomerController --resource --api
```

[Example output](https://github.com/timwassenburg/laravel-improved-resource-controllers/tree/master/examples/DefaultApiResourceController.php)

### Model resource controller

[](#model-resource-controller)

```
php artisan make:controller CustomerController --resource --model=Customer
```

[Example output](https://github.com/timwassenburg/laravel-improved-resource-controllers/tree/master/examples/ModelResourceController.php)

### Model API resource controller

[](#model-api-resource-controller)

```
php artisan make:controller CustomerController --resource --model=Customer --api
```

[Example output](https://github.com/timwassenburg/laravel-improved-resource-controllers/tree/master/examples/ModelApiResourceController.php)

### Nested resource controller

[](#nested-resource-controller)

```
php artisan make:controller CityController --resource --parent=Country --model=City
```

[Example output](https://github.com/timwassenburg/laravel-improved-resource-controllers/tree/master/examples/NestedResourceController.php)

### Nested API resource controller

[](#nested-api-resource-controller)

```
php artisan make:controller CityController --resource --parent=Country --model=City --api
```

[Example output](https://github.com/timwassenburg/laravel-improved-resource-controllers/tree/master/examples/NestedApiResourceController.php)

Variables
---------

[](#variables)

In the stubs you can use the following variables.

### General

[](#general)

VariableOutput{{ namespace }}App\\Http\\Controllers{{ namespacedModel }}App\\Models\\Order{{ class }}OrderController{{ model }}Order{{ modelVariable }}order{{ modelVariablePlural }}orders### With parent (--parent=Customer)

[](#with-parent---parentcustomer)

VariableOutput{{ namespacedParentModel }}App\\Models\\Customer{{ parentModelVariable }}customer{{ parentModelVariablePlural }}customersMore generator packages
-----------------------

[](#more-generator-packages)

Looking for more ways to speed up your workflow? Make sure to check out these packages.

- [Laravel Repository Generator](https://github.com/timwassenburg/laravel-repository-generator)
- [Laravel Service Generator](https://github.com/timwassenburg/laravel-service-generator)
- [Laravel Action Generator](https://github.com/timwassenburg/laravel-action-generator)

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

[](#contributing)

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% 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 ~51 days

Total

5

Last Release

1513d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18ef476c8a9d76d44ab65724fb4be330c1c4ce90e2be793bc4628b85bd0d5ba5?d=identicon)[timwass](/maintainers/timwass)

---

Top Contributors

[![timwassenburg](https://avatars.githubusercontent.com/u/75377381?v=4)](https://github.com/timwassenburg "timwassenburg (18 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

artisancommandcontrollercrudgeneratorlaravelresourcephpclilaravelgeneratorartisancontrollersresourcecrud

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/timwassenburg-laravel-improved-resource-controllers/health.svg)

```
[![Health](https://phpackages.com/badges/timwassenburg-laravel-improved-resource-controllers/health.svg)](https://phpackages.com/packages/timwassenburg-laravel-improved-resource-controllers)
```

###  Alternatives

[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2582.1M11](/packages/nunomaduro-laravel-console-task)[timwassenburg/laravel-service-generator

Generate Laravel services

104233.1k2](/packages/timwassenburg-laravel-service-generator)[nunomaduro/laravel-console-summary

A Beautiful Laravel Console Summary for your Laravel/Laravel Zero commands.

662.0M3](/packages/nunomaduro-laravel-console-summary)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16255.4k7](/packages/nunomaduro-laravel-console-dusk)

PHPackages © 2026

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