PHPackages                             carlosafonso/laravel-crud - 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. [Framework](/categories/framework)
4. /
5. carlosafonso/laravel-crud

ActiveLibrary[Framework](/categories/framework)

carlosafonso/laravel-crud
=========================

Convenience layer on top of the Laravel framework for developing CRUD applications

1.0.0(10y ago)2929[4 issues](https://github.com/carlosafonso/laravel-crud/issues)PHPPHP &gt;=5.5.0

Since Nov 20Pushed 9y ago2 watchersCompare

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

READMEChangelogDependencies (5)Versions (3)Used By (0)

laravel-crud
============

[](#laravel-crud)

[![Build Status](https://camo.githubusercontent.com/182bc12d1d7ce1510db7ba6941fa4db75289381f81c3cb15183862eb62bae9db/68747470733a2f2f7472617669732d63692e6f72672f6361726c6f7361666f6e736f2f6c61726176656c2d637275642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/carlosafonso/laravel-crud)[![Code Climate](https://camo.githubusercontent.com/b7f724a63a6b667350084eb37d9ce687f072715c21fda07007a80a125f7bc96d/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6361726c6f7361666f6e736f2f6c61726176656c2d637275642f6261646765732f6770612e737667)](https://codeclimate.com/github/carlosafonso/laravel-crud)[![Test Coverage](https://camo.githubusercontent.com/446df0c8c63f8745269d8a783a9798e28d6752e6be467a7eb02eb1b05a66949d/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6361726c6f7361666f6e736f2f6c61726176656c2d637275642f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/carlosafonso/laravel-crud/coverage)

Convenience layer on top of the Laravel framework for developing CRUD applications

Description
-----------

[](#description)

This project aims to be a useful layer on top of the excellent Laravel framework to ease up the development of CRUD applications. It avoids developers the repeating tasks of developing CRUD logic and allows them to concentrate on the specifics of their application domains.

Projected features
------------------

[](#projected-features)

- Unobstrusive.
- Heavily customizable with hooks and overridable functions.
- Useful both for RESTful APIs (JSON) and standard HTML responses.
- Developed with good practices and design patterns in mind.

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

[](#installation)

Install this package via Composer:

```
composer require carlosafonso/laravel-crud

```

Then add `Afonso\LvCrud\Providers\LvCrudServiceProvider::class` to the list of providers in `config/app.php`.

Don't forget to publish the configuration file specific to this package:

```
php artisan vendor:publish --provider="Afonso\LvCrud\Providers\LvCrudServiceProvider"

```

This will add a new configuration file called `crud.php` inside your `config` folder.

Usage
-----

[](#usage)

Have any of your controllers extend from `Afonso\LvCrud\Controllers\CrudController`:

```
use Afonso\LvCrud\Controllers\CrudController;

class FoosController extends CrudController
{
    //
}
```

This will automatically enable the CRUD behavior.

### Default model namespace

[](#default-model-namespace)

This library assumes that all models are namespaced under `App`:

```
App\Controllers\FoosController -> App\Foo

```

If your code does not follow this convention, the default model namespace can be specified by overriding the `getModelNamespace` function in your controller.

```
public function getModelNamespace()
{
    return 'My\\Custom\\Namespace';
}
```

### CrudModelInterface

[](#crudmodelinterface)

This library expects all related models to implement `Afonso\LvCrud\Models\CrudModelInterface`. You can either do this for all models or just implement this on a base model class that you will later extend and override if necessary.

### HTML/JSON support

[](#htmljson-support)

By default, CRUD controllers support both JSON and HTML responses. This behavior can be tuned by overriding the following functions:

```
/*
 * In this example we're only supporting JSON responses.
 */

public function supportsJson()
{
    return true;
}

public function supportsHtml()
{
    return false;
}
```

### Read-only controllers

[](#read-only-controllers)

Read-only controllers don't allow creating, updating or deleting data.

A controller can be declared as read-only by setting the `$readOnly` flag to `true`:

```
class MyController extends CrudController
{
    protected $readOnly = true;
}
```

Read-only controllers will return with an HTTP status of `405 Method Not Allowed` when doing POSTs, PUTs or DELETEs on the resource.

Configuration options
---------------------

[](#configuration-options)

The following attributes can be modified in the configuration file, `crud.php`:

### default\_items\_per\_page

[](#default_items_per_page)

The default number of entitites per page when the URL param `page_size` is not specified.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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 ~169 days

Total

2

Last Release

3662d ago

Major Versions

0.1.0 → 1.0.02016-05-08

PHP version history (2 changes)0.1.0PHP &gt;=5.4.0

1.0.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/298322ba620ba6518bce36e896723f1f771c4ee6257ab49548c45dcb06e2b9ce?d=identicon)[carlosafonso](/maintainers/carlosafonso)

---

Top Contributors

[![carlosafonso](https://avatars.githubusercontent.com/u/1700229?v=4)](https://github.com/carlosafonso "carlosafonso (21 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/carlosafonso-laravel-crud/health.svg)

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

###  Alternatives

[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)[ecotone/laravel

Laravel integration for Ecotone

21307.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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