PHPackages                             bensherred/laravel-make-model - 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. bensherred/laravel-make-model

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

bensherred/laravel-make-model
=============================

A Laravel package which extends the make:model command to create everything you need for a new feature

v1.2.0(6y ago)49.1k↓50%MITPHP

Since Aug 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bensherred/laravel-make-model)[ Packagist](https://packagist.org/packages/bensherred/laravel-make-model)[ RSS](/packages/bensherred-laravel-make-model/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Laravel Make Model
==================

[](#laravel-make-model)

This package extends the Laravel make:controller and make:model commands to create policies, requests and views all within 1 command. The arguments you specify will also affect the controller that gets generated. Installing this package also creates a make:view command.

- [Installation](#installation)
- [Usage](#usage)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install this package via composer:

```
composer require bensherred/laravel-make-model
```

The service provider will automatically register or you may manually add the service provider in your `config/app.php` file:

```
'providers' => [
    // ...
    BenSherred\MakeModel\MakeModelServiceProvider::class,
];
```

Usage
-----

[](#usage)

There are 2 parts to this package, the extension of the Laravel make:model command and the Laravel make:controller command.

### make:model

[](#makemodel)

If you run the following command, you will notice 1 extra option and that the *--all* argument has been updated.

First off, running the following command will not only generate a migration, factory and resource controller but it will also now create a policy, request classes and views.

```
php artisan make:model Post --all
```

The additional classes/files that will get created for this example are:

- app/Http/Requests/Post/StorePostRequest.php
- app/Http/Requests/Post/UpdatePostRequest.php
- app/Policies/PostPolicy.php
- resources/views/post/create.blade.php
- resources/views/post/edit.blade.php
- resources/views/post/index.blade.php
- resources/views/post/show.blade.php

The controller that gets generated will automatically return the views, include the requests and policy.

Another option that is available is to just create the policy for the model. This can be done by running the following command:

```
php artisan make:model Post --policy
```

### make:controller

[](#makecontroller)

The extension of the make:controller is very similar to the make:model command, but has a few additional options.

##### Creating a policy

[](#creating-a-policy)

To create a policy along with the controller you can add the --policy option. This will only get added to the controller automatically if you specify a model for the controller.

```
php artisan make:controller PostController --model=Post --policy
```

Running the above command will create a resource controller and use the Post model, along with creating the PostPolicy and including the authorizeResource option in the controller.

If you already have a policy or would like a custom name for a policy you can run the following command:

```
php artisan make:controller PostController --model=Post --policy=PostPolicy
```

**If you create a resource controller the policy will be create, but the authorizeResource option will not be automatically added to the controller.**

##### Create requests

[](#create-requests)

If you would like to create custom request classes for your controller, you can add the --requests option to the command. This will create a {Model}StoreRequest and {Model}UpdateRequest class under app/Http/Requests/{Model}/.

This option will work for both model controllers and resource controllers. If you create a model controller by specifying the --model= option, it will use the model name to create the requests folder. However, if you create a resource controller, it will remove the world Controller from the controller name and use that instead.

```
php artisan make:controller PostController --resource --requests
```

Therefore, running the following command will create a StorePostRequest and UpdatePostRequest class under app/Http/Requests/Post.

##### Create views

[](#create-views)

Another option which has been added to the make:controller command is the ability to automatically create views. You can this by specifying the --views option. If you were creating a PostController and added this option, the following views would be created under a folder called post:

- create.blade.php
- edit.blade.php
- index.blade.php
- show.blade.php

Like the --requests option, if you specify a model it will use the model name for the folder. However, if you create a resource controller it will work out the name of the folder based on the controller name.

If you create a model or resource controller, the views will also be automatically added to the controller. If a model controller is generated, it will also pass the model through to the controller.

**Please note if you specify the --api option, this option will be ignored**

##### Using multiple options

[](#using-multiple-options)

If you would like to use multiple options, you can daisy chain them on.

For example, running the command below would create a model controller along with then policy and the 2 request classes:

```
php artisan make:controller PostController --model=Post --policy --requests
```

Alternatively, you can use all 3 together:

```
php artisan make:controller PostController --model=Post --policy --requests --views
```

### make:view

[](#makeview)

This package also creates a make:view command available.

Running the following command will create an index.blade.php file under a blog folder in views.

```
php artisan make:view blog/index
```

Credits
-------

[](#credits)

- [Ben Sherred](https://github.com/bensherred)
- [ShawnCZek](https://github.com/shawnczek)

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 67.4% 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 ~40 days

Total

4

Last Release

2354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a81c5266912c039021715b77d96ad65b6aac3a76f39430331f31ea240f0c14e?d=identicon)[bensherred](/maintainers/bensherred)

![](https://www.gravatar.com/avatar/71710754e0b036339b726720a418bd2c283550c25f954d3a3d8c9280fbcf4a2e?d=identicon)[ShawnCZek](/maintainers/ShawnCZek)

---

Top Contributors

[![bensherred](https://avatars.githubusercontent.com/u/22666637?v=4)](https://github.com/bensherred "bensherred (29 commits)")[![ShawnCZek](https://avatars.githubusercontent.com/u/15310717?v=4)](https://github.com/ShawnCZek "ShawnCZek (13 commits)")[![Krashnz](https://avatars.githubusercontent.com/u/6030086?v=4)](https://github.com/Krashnz "Krashnz (1 commits)")

### Embed Badge

![Health badge](/badges/bensherred-laravel-make-model/health.svg)

```
[![Health](https://phpackages.com/badges/bensherred-laravel-make-model/health.svg)](https://phpackages.com/packages/bensherred-laravel-make-model)
```

###  Alternatives

[webflo/drupal-finder

Helper class to locate a Drupal installation.

12653.2M218](/packages/webflo-drupal-finder)[rankmath/seo-by-rank-math

Rank Math is the most powerful way to get BEST WordPress SEO tools added to your website.

1252.0k](/packages/rankmath-seo-by-rank-math)[thiktak/filament-nested-builder-form

Plugin for FilamentPHP - Nested Builder Form Component

208.6k1](/packages/thiktak-filament-nested-builder-form)[thiktak/filament-simple-list-entry

Simple List Entry for Infolist

223.9k](/packages/thiktak-filament-simple-list-entry)[radialapps/banner-warn

Show avatars in roundcube message list with warnings

131.0k](/packages/radialapps-banner-warn)

PHPackages © 2026

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