PHPackages                             brstreet2/laracrud - 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. brstreet2/laracrud

ActiveLibrary[API Development](/categories/api)

brstreet2/laracrud
==================

A Laravel package for generating API CRUD functionality

1.1.1(12mo ago)06MITPHPPHP ^8.4

Since May 11Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/brstreet2/laracrud)[ Packagist](https://packagist.org/packages/brstreet2/laracrud)[ RSS](/packages/brstreet2-laracrud/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

LaraCRUD
========

[](#laracrud)

LaraCRUD is a Laravel package designed to streamline the creation of API CRUD (Create, Read, Update, Delete) operations. It automates the generation of models, controllers, migrations, factories, routes, and more, enabling developers to focus on building features instead of repetitive boilerplate code.

> **Inspiration**
> This package was inspired by the efficient workflows and best practices advocated at my workplace. Special thanks to my engineering manager for the insightful guidance and the foundational idea behind LaraCRUD.

---

Features
--------

[](#features)

- Generates Eloquent models with optional migrations.
- Creates API controllers with full CRUD functionality, including validation requests.
- Sets up API routes automatically with customizable naming conventions.
- Produces factories for model testing.
- Generates feature tests for the API CRUD operations.
- Supports interactive prompts for missing components.
- Leverages customizable stubs for controllers, requests, and tests.

---

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

[](#installation)

Install the package via Composer:

```
composer require brstreet2/laracrud --dev
```

If you prefer to install it globally:

```
composer global require brstreet2/laracrud
```

---

Usage
-----

[](#usage)

To generate CRUD operations for a specific model:

```
php artisan brstreet:api-crud {ModelName}
```

If the model does not exist, the command will prompt you to create it along with an optional migration.

---

Example
-------

[](#example)

Generating CRUD for a `Post` model:

```
php artisan brstreet:api-crud Post
```

### Files and Routes Created

[](#files-and-routes-created)

1. **Model**

    - File: `app/Models/Post.php`
    - If the model does not exist, the command will generate a new model.
2. **Controller**

    - File: `app/Http/Controllers/Api/PostController.php`
    - A full-featured controller is created under the `Api` namespace.
3. **Migration**

    - File: `database/migrations/xxxx_xx_xx_create_posts_table.php`
    - If no migration exists for the table, a new migration file is created.
4. **Factory**

    - File: `database/factories/PostFactory.php`
    - A factory is created to support testing and seeding the model.
5. **Routes**

    - Added in `routes/api.php`: ```
        Route::apiResource('posts', PostController::class)->names('posts');
        ```
    - The route path uses plural kebab case (`posts`), and route names are in plural snake case (`posts.index`, `posts.store`, etc.).
6. **Request Classes** (generated if the controller is created)

    - Files:
        - `app/Http/Requests/Post/IndexRequest.php`
        - `app/Http/Requests/Post/CreateRequest.php`
        - `app/Http/Requests/Post/UpdateRequest.php`
    - These handle validation and permissions for API actions.
7. **Resource Class**

    - File: `app/Http/Resources/PostResource.php`
    - Encapsulates the model data for API responses.
8. **Feature Test**

    - File: `tests/Feature/PostControllerTest.php`
    - A test file is generated to validate the API's behavior.

---

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

[](#contributing)

Contributions are welcome! Please fork the repository and submit a pull request.

---

License
-------

[](#license)

This project is open-sourced software licensed under the [MIT license](LICENSE).

---

Credits
-------

[](#credits)

- Developed by [brstreet2](https://github.com/brstreet2)
- Inspired by the engineering practices at my workplace, with special thanks to my engineering manager for the foundational idea.

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance52

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

363d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81a74029faee3489359606b3546aebd58c9e3615885d46775d7a16d1d4d68448?d=identicon)[brstreet2](/maintainers/brstreet2)

---

Top Contributors

[![brstreet2](https://avatars.githubusercontent.com/u/83747032?v=4)](https://github.com/brstreet2 "brstreet2 (19 commits)")

### Embed Badge

![Health badge](/badges/brstreet2-laracrud/health.svg)

```
[![Health](https://phpackages.com/badges/brstreet2-laracrud/health.svg)](https://phpackages.com/packages/brstreet2-laracrud)
```

###  Alternatives

[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[spatie/laravel-route-discovery

Auto register routes using PHP attributes

23645.0k2](/packages/spatie-laravel-route-discovery)[esign/laravel-conversions-api

A laravel wrapper package around the Facebook Conversions API

69145.4k](/packages/esign-laravel-conversions-api)[didww/didww-api-3-php-sdk

PHP SDK for DIDWW API 3

1218.2k](/packages/didww-didww-api-3-php-sdk)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)

PHPackages © 2026

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