PHPackages                             kwaadpepper/crud-policies - 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. [Admin Panels](/categories/admin)
4. /
5. kwaadpepper/crud-policies

ActiveLibrary[Admin Panels](/categories/admin)

kwaadpepper/crud-policies
=========================

Makes CRUD easy, make policies easy and everyone happy

6.0.1(1mo ago)35303MITPHP

Since Jul 15Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/Kwaadpepper/crud-policies)[ Packagist](https://packagist.org/packages/kwaadpepper/crud-policies)[ Docs](https://github.com/kwaadpepper/crud-policies)[ RSS](/packages/kwaadpepper-crud-policies/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (18)Versions (48)Used By (0)

Crud + Policies for scaffolding work purposes
=============================================

[](#crud--policies-for-scaffolding-work-purposes)

[![Latest Version on Packagist](https://camo.githubusercontent.com/765459845e14bb8b951cb874344512362472444e24906c68efc782d938f1b98e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b776161647065707065722f637275642d706f6c69636965733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kwaadpepper/crud-policies)[![Total Downloads](https://camo.githubusercontent.com/0880da64764a397a797e148c33dbf58fdb5097228aa811fa8d6deb1947f9391a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b776161647065707065722f637275642d706f6c69636965733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kwaadpepper/crud-policies)

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

[](#installation)

composer require kwaadpepper/crud-policies

CSP
---

[](#csp)

If you wish to make this package CSP compliant you shall share to all views a `$nonce` variable. Note that ckeditor will require unsafe-inline style anyway.

Usage
-----

[](#usage)

1. [Create a model](#create-a-model-iscrudmodel) that will use the `Kwaadpepper\CrudPolicies\IsCrudModel` trait
2. [Create a controller](#create-a-controller-crudcontroller) that will use the `Kwaadpepper\CrudPolicies\CrudController` trait
3. [Create a policy](#create-a-policy-rootpolicy) that will extends the `Kwaadpepper\CrudPolicies\Policies\RootPolicy` class

### Create a Model (IsCrudModel)

[](#create-a-model-iscrudmodel)

- Use `php artisan make:crudModel  ModelName`
- Do it by hand

If You choose to do it by hand take the file [examples/CrudModel.php](examples/CrudModel.php) as an example.

Some infos :

- The model has to use `IsCrudModel` trait
- rules for models fields has to be **set in the constructor** as the provided example (*$editableProperties* prop)
- Each **CrudType** enum is handled in a specific way more doc will be to come, or are welcome if you are willing to write it
- **Requests validation** are constructed from the model for *create* and *update* actions
- Your model has to set **`protected $crudLabelColumn = 'string column name';`**
- Your model has to set **`protected $crudValueColumn = 'unique constrained column name';`**

**! The two last points are specially needed for relations !**

---

### Create a Controller (CrudController)

[](#create-a-controller-crudcontroller)

- Use `php artisan make:crudController  ControllerName`
- Do it by hand

If You choose to do it by hand take the file [examples/CrudController.php](examples/CrudController.php) as an example.

Some hooks are available in the controller, you can also overload methods to handle your own way the think

You can of course write your own methods to handle the rest of your application.

More documentation is yet to come, dont hesite to check in code directly

---

### Create a Policy (RootPolicy)

[](#create-a-policy-rootpolicy)

- Use `php artisan make:policy ModelName`
- Do it by hand

If You choose to do it by hand take the file [examples/CrudPolicy.php](examples/CrudPolicy.php) as an example.

Note that policies rules make method returns a boolean value. You can find an example of rules in [examples/UserRoleRules.php](examples/UserRoleRules.php)

---

**NOTE: Artisan make commands yet has to be developped**
--------------------------------------------------------

[](#note-artisan-make-commands-yet-has-to-be-developped)

Notes:
------

[](#notes)

- For crud type images, you must do `php artisan storage:link`

---

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

SOON available

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

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Jérémy Munsch](https://jeremydev.ovh)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 68.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 ~37 days

Recently: every ~317 days

Total

47

Last Release

54d ago

Major Versions

0.4.8 → 5.0.02022-09-28

5.0.2 → 6.0.02026-03-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d6fe69e010efceae2bd9a92eb6463139fff339c94c545b6b7b1210a00d963e4?d=identicon)[Kwaadpepper](/maintainers/Kwaadpepper)

---

Top Contributors

[![Kwaadpepper](https://avatars.githubusercontent.com/u/6019313?v=4)](https://github.com/Kwaadpepper "Kwaadpepper (11 commits)")[![Sulantis](https://avatars.githubusercontent.com/u/19820140?v=4)](https://github.com/Sulantis "Sulantis (4 commits)")[![vbridier](https://avatars.githubusercontent.com/u/16559661?v=4)](https://github.com/vbridier "vbridier (1 commits)")

---

Tags

crudlaravelpolicieslaravelcrudpoliciesScafolding

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kwaadpepper-crud-policies/health.svg)

```
[![Health](https://phpackages.com/badges/kwaadpepper-crud-policies/health.svg)](https://phpackages.com/packages/kwaadpepper-crud-policies)
```

###  Alternatives

[takielias/tablar-crud-generator

Laravel Tablar Crud Generator based on https://github.com/takielias/tablar

315.6k](/packages/takielias-tablar-crud-generator)

PHPackages © 2026

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