PHPackages                             andreacivita/api-crud-generator - 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. [API Development](/categories/api)
4. /
5. andreacivita/api-crud-generator

ActiveLibrary[API Development](/categories/api)

andreacivita/api-crud-generator
===============================

Simple API Crud generator for Laravel

0.5.1(4y ago)131.2k3[4 issues](https://github.com/andreacivita/Laravel-ApiCrudGenerator/issues)[1 PRs](https://github.com/andreacivita/Laravel-ApiCrudGenerator/pulls)MITPHPPHP ^7.3|^8.0CI failing

Since Dec 28Pushed 4y ago2 watchersCompare

[ Source](https://github.com/andreacivita/Laravel-ApiCrudGenerator)[ Packagist](https://packagist.org/packages/andreacivita/api-crud-generator)[ RSS](/packages/andreacivita-api-crud-generator/feed)WikiDiscussions master Synced 1w ago

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

[![Build Status](https://camo.githubusercontent.com/2360febde6086b925e5b541fa6e276cf77b9af24f013a38f90ea21592f7a538f/68747470733a2f2f7472617669732d63692e6f72672f616e647265616369766974612f4c61726176656c2d4170694372756447656e657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/andreacivita/Laravel-ApiCrudGenerator)[![codecov](https://camo.githubusercontent.com/35412010e5b7c8c9f1b18985185b4039293cfa907fbe4443aca6777c0e00595e/68747470733a2f2f636f6465636f762e696f2f67682f616e647265616369766974612f4c61726176656c2d4170694372756447656e657261746f722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/andreacivita/Laravel-ApiCrudGenerator)[![](https://camo.githubusercontent.com/ac23d64e6074b99c7e1da4c9713cd9567a68f297b5538a1cb1a438c6ac5d2ac3/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f65323233393865643030353839303034386362352f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/andreacivita/Laravel-ApiCrudGenerator/maintainability)[![Codacy Badge](https://camo.githubusercontent.com/e80f68746649372f6f3ba7a6c260adfedeb118b89aa34bdc5b919f0c2874cd91/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3966333436323932393263393463626262323963633664653735343635623234)](https://app.codacy.com/app/andreacivita/Laravel-ApiCrudGenerator?utm_source=github.com&utm_medium=referral&utm_content=andreacivita/Laravel-ApiCrudGenerator&utm_campaign=Badge_Grade_Dashboard)[![Latest Stable Version](https://camo.githubusercontent.com/a7e56aae75acd296582b577d5b2c629f009ece9d9fe12356d56e44c202d0093a/68747470733a2f2f706f7365722e707567782e6f72672f616e647265616369766974612f6170692d637275642d67656e657261746f722f762f737461626c65)](https://packagist.org/packages/andreacivita/api-crud-generator)[![License](https://camo.githubusercontent.com/5d9d39041ba0dc4f21f7f2505ce6ecfcb9dac94752552cb5765c80c35d0bf6f9/68747470733a2f2f706f7365722e707567782e6f72672f616e647265616369766974612f6170692d637275642d67656e657261746f722f6c6963656e7365)](https://packagist.org/packages/andreacivita/api-crud-generator)

Laravel | API CRUD Generator
============================

[](#laravel--api-crud-generator)

This Generator package provides generators of Models, Controllers, Request, Routes &amp; Tests for a painless development.

INSTALL
-------

[](#install)

Install the package through [Composer](https://getcomposer.org/).

Run the Composer require command from the Terminal:

```
composer require andreacivita/api-crud-generator --dev
```

### SETUP

[](#setup)

Run this command from the Terminal

```
php artisan vendor:publish
```

Select andreacivita/api-crud-generator and setup it's complete.

USAGE
-----

[](#usage)

### Managing all database

[](#managing-all-database)

Usage of this package is very simple.

First, let's supposing I want to generate CRUD for all table in my db.

So, we run

```
php artisan make:crud --all
```

No further options required. Your setup is complete!

### Interactive mode

[](#interactive-mode)

You can manage a single table with interactive mode or manually (see [next paragraph](https://github.com/andreacivita/Laravel-ApiCrudGenerator#managing-a-single-db-table)).

Just run

```
php artisan make:crud --interactive
```

Crud generator will ask you several data (Name of resource, Table name and use of timestamps).

### Managing a single db table

[](#managing-a-single-db-table)

Now i suppose generation of CRUD operations of Car db table.

Run this command:

```
php artisan make:crud Car
```

Done! You will have Car model (located in App/Model directory), CarController, CarRequest (used for input data) and Routes (located in routes/api.php).

### OPTIONS

[](#options)

#### TABLE NAME

[](#table-name)

By default, DB Table's name is plural, while Model class name is singular (e.g. Table =&gt; Cars, Model =&gt; Car). You can change this behavior specifying the name in terminal

```
php artisan make:crud Car --table Car
```

This will create the same resources, but table name in model will be 'Car' (instead of default 'Cars')

#### TIMESTAMPS

[](#timestamps)

By default, this packages will set all timestamps to false. You can change this doing this command:

```
php artisan make:crud Car --timestamps true
```

This will set 'timestamps=true' in Model class.

#### LARAVEL/PASSPORT INTEGRATION

[](#laravelpassport-integration)

By default, Routes will be not protected by passport. However, you can generate Passport-protected routes with:

```
php artisan make:crud Car --passport
```

This will set 'timestamps=true' in Model class.

ROUTING
-------

[](#routing)

Routes will follow Route::resource() Schema (default routing schema provided by Laravel).

Example: i'm generating Car crud

RouteMethodOperationcarGETGet all carscar/{id}GETFind car by idcarPOSTInsert a new carcar/{id}PUT / PATCHUpdate car by idcar/{id}DELETEDelete car by idRemember that all api routes have 'api/' prefix.

TESTING
-------

[](#testing)

When created CRUD structure (Controllers, Models, Request, Resource, Factory &amp; Routes), this package generate Feature test file.

---

SETUP GENERATED CRUD
--------------------

[](#setup-generated-crud)

### FACTORIES

[](#factories)

Tests now require factory class to manipulate data. You should provide data schema into your factory class (using Faker), so you'll be able to test easily your API

### VALIDATORS

[](#validators)

Write better code will helps you so much! So, default behavior of Controllers is to force you to use validated data. You have to set all validation rules into your FormRequest class.

E.g. For Car Crud, you will set rules into your App\\Request\\CarRequest.php

---

CONTRIBUTING
------------

[](#contributing)

This package is covered by MIT license. You are able to do whatever you want with this code.

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities. You can see issues or enhancement and assign task for contributing :)

How can I thank you?
--------------------

[](#how-can-i-thank-you)

Star this repo or follow me on GitHub. And, if you want, you can share this link! :)

---

AUTHORS
-------

[](#authors)

This package has been originally developed by [Andrea Civita](https://github.com/andreacivita)
A special thanks goes to [Bastianjoel](https://github.com/bastianjoel) for it's pull request

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 98.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 ~89 days

Recently: every ~125 days

Total

14

Last Release

1535d ago

PHP version history (2 changes)0.1PHP ^7.1.3

0.4.5PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ca8ae45c81288c22836f584e70c2e3dd2ac2ef2a22bea404d5eb91b4f669649?d=identicon)[andreacivita](/maintainers/andreacivita)

---

Top Contributors

[![andreacivita](https://avatars.githubusercontent.com/u/4959092?v=4)](https://github.com/andreacivita "andreacivita (67 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")

---

Tags

apicrudcrud-generatorgeneratorhacktoberfestlaravellaravel-apilaravel-packagephplaravelcrudcrud generatorlaravel crud generatorapi-generator

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/andreacivita-api-crud-generator/health.svg)

```
[![Health](https://phpackages.com/badges/andreacivita-api-crud-generator/health.svg)](https://phpackages.com/packages/andreacivita-api-crud-generator)
```

###  Alternatives

[appzcoder/crud-generator

Laravel CRUD Generator

1.4k581.4k7](/packages/appzcoder-crud-generator)[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)
