PHPackages                             milwad/laravel-crod - 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. milwad/laravel-crod

ActiveLibrary[Admin Panels](/categories/admin)

milwad/laravel-crod
===================

Make easy &amp; fast crud

v1.5.0(1y ago)1258.1k—6.3%15[1 PRs](https://github.com/milwad-dev/laravel-crod/pulls)MITPHPPHP ^8.0CI passing

Since Jan 26Pushed 4mo ago6 watchersCompare

[ Source](https://github.com/milwad-dev/laravel-crod)[ Packagist](https://packagist.org/packages/milwad/laravel-crod)[ GitHub Sponsors](https://github.com/milwad)[ RSS](/packages/milwad-laravel-crod/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (12)Used By (0)

Laravel Crod
============

[](#laravel-crod)

[![](https://camo.githubusercontent.com/52dd15830f012d47beb86857693047a9f1ffec54e5e9ac7ced1e66bc79be56a7/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c25323043726f642e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6d696c7761642532466c61726176656c2d63726f64267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d47656e65726174652b637275642b66696c65732b65617379266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/52dd15830f012d47beb86857693047a9f1ffec54e5e9ac7ced1e66bc79be56a7/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c25323043726f642e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6d696c7761642532466c61726176656c2d63726f64267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d47656e65726174652b637275642b66696c65732b65617379266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

[![PHP Version Require](https://camo.githubusercontent.com/9a7a9f4c4ea6880de026021591bd6fd565a0f36edd24265075f926e40ca3b986/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6d696c7761642f6c61726176656c2d63726f642f7068702e737667)](https://packagist.org/packages/milwad/laravel-crod)[![Latest Stable Version](https://camo.githubusercontent.com/368c4183fb99be52718c35aed2419d41b9ca31485d64806eea73f3e7ae778d7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696c7761642f6c61726176656c2d63726f642e737667)](https://packagist.org/packages/milwad/laravel-crod)[![Total Downloads](https://camo.githubusercontent.com/16dc4409aa683a3aec483ab97081e2afd244cfd463ef528d3a7e1b5d3d977c71/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696c7761642f6c61726176656c2d63726f642e737667)](https://packagist.org/packages/milwad/laravel-crod)[![License](https://camo.githubusercontent.com/8c2e18782a16d3276e64e989a903a6e9af9a42254a5886653b04f7513996711d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d696c7761642f6c61726176656c2d63726f642e737667)](https://packagist.org/packages/milwad/laravel-crod)[![Passed Tests](https://github.com/milwad-dev/laravel-crod/actions/workflows/run-tests.yml/badge.svg)](https://github.com/milwad-dev/laravel-crod/actions/workflows/run-tests.yml)

---

Laravel crod is a package for implementing CRUD faster and easier. You can quickly create controllers, models, migrations, services, repositories, views, and requests. You can make it automatically fillable for models, query for repositories and services, make resource controllers, and have a lot of options.

Docs:

Requirements
------------

[](#requirements)

---

- `PHP: ^8.0`
- `Laravel framework: ^9`
- `doctrine/dbal: ^3.6`

CrodL7L8L9L10L11L121.0✅✅✅❌❌❌1.1❌❌✅✅✅❌1.2❌❌✅✅✅❌1.3❌❌✅✅✅❌1.4❌❌✅✅✅❌1.5❌❌✅✅✅✅Installation
------------

[](#installation)

---

```
composer require milwad/laravel-crod
```

After installation, you need to publish config files.

```
php artisan vendor:publish --provider="Milwad\LaravelCrod\LaravelCrodServiceProvider" --tag="laravel-crod-config"
```

Check active commands
---------------------

[](#check-active-commands)

When you install the `Laravel Crod`, a series of commands will be activated for you. For see these commands, you can run below command:

```
php artisan
```

[![Crod commands](https://camo.githubusercontent.com/c92ad0b6d3627262f1dbbb54170a48dce04931883089e29197fd20d1118d53a1/68747470733a2f2f73362e7575706c6f61642e69722f66696c65732f636172626f6e5f2831295f74716d712e706e67 "Crod commands")](https://camo.githubusercontent.com/c92ad0b6d3627262f1dbbb54170a48dce04931883089e29197fd20d1118d53a1/68747470733a2f2f73362e7575706c6f61642e69722f66696c65732f636172626f6e5f2831295f74716d712e706e67)

Make CRUD files
---------------

[](#make-crud-files)

For creating crud files, you need to run the `crud:make` command in your terminal:

```
php artisan crud:make {name}
```

For example

```
php artisan crud:make Product
```

When you execute this command, after creating the files, you will see a list of options that will create a series of additional files for you, which of course are optional, you can choose and if you need, it will create additional files for you such as `seeder`, `factory`, `repository`, etc.

✅ After, you can see `Laravel Crod` creates crud files such as `Model`, `Controller`, `Form-Requests`, `Migrations`, etc.

CRUD Query
----------

[](#crud-query)

If you run the `crud:query` command, the result is:

- Add `index`, `create`, `store`, `edit`, `update`, `destroy` functions to your controller
- Get all migration columns and move them to your model fillable
- Add `index`, `findById`, and `delete` functions to your repositories
- Add `store`, `update` functions to your services
- Add resource route (SOON)

**\*\* You must run the migrate command before the `crud:query` command. \*\***

```
php artisan migrate
```

For using the automatic query, you can run below command:

```
php artisan crud:query {table_name} {model} {--id-controller}
```

For example:

```
php artisan crud:query products Product
```

When you add `--id-controller` option, the `Laravel Crod` creates crud functions without [Route Model Binding](https://laravel.com/docs/routing#route-model-binding) in the controller.

After you can see `Laravel Crod` added query to service, repository, controller, model, etc.

CRUD for Module
---------------

[](#crud-for-module)

If you are using Modular Architecture, you can run the `crud:make-module` command. This command creates a new module and creates the default CRUD files such as `Model`, `Controller`, `Migration`, etc:

```
php artisan crud:make-module {module_name}
```

For example:

```
php artisan crud:make-module Product
```

When you execute this command, after creating the files, you will see a list of options that will create a series of additional files for you, which of course are optional, you can choose and if you need, it will create additional files for you such as `seeder`, `factory`, `repository`, etc.

CRUD Query for Module
---------------------

[](#crud-query-for-module)

This command adds a query and a date to the CRUD files for the module. This command is similar to the `crud:query` command, but this command is for the module. If you have a module, you can write your module name and `Laravel Crod` find it automatically.

\*\* You must run your migration file \*\*

```
php artisan crud:query-module {table_name} {model} {--id-controller}

```

For example:

```
php artisan crud:query-module products Product
```

OR

```
php artisan crud:query-module products Product --id-controller
```

When you add `--id-controller` option, the `Laravel Crod` creates crud functions without [Route Model Binding](https://laravel.com/docs/routing#route-model-binding) in the controller.

After you can see `Laravel Crod` added query to service, repository, controller, model, ... for your module.

Custom path
-----------

[](#custom-path)

You can customize the file path in a config file. ``````

With `Laravel Crod` config, you can customize the commands, for example, you want to set the route file name. This config file exists in `config/laravel-crod.php`:

```
