PHPackages                             leogopal/laravel-startercrud - 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. leogopal/laravel-startercrud

ActiveLibrary

leogopal/laravel-startercrud
============================

A CRUD Artisan helper for the Laravel Starterkit

1.0.0(7y ago)093MITPHPPHP &gt;=5.5.0

Since Mar 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/leogopal/laravel-startercrud)[ Packagist](https://packagist.org/packages/leogopal/laravel-startercrud)[ Docs](https://github.com/leogopal/laravel-startercrud)[ RSS](/packages/leogopal-laravel-startercrud/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel Starterkit Artisan CRUD
===============================

[](#laravel-starterkit-artisan-crud)

[![Latest Stable Version](https://camo.githubusercontent.com/4c29de2d112754f58b0f3c38e88cbcbcd839afaee95d0c58a78aeb3b6b00b38d/68747470733a2f2f706f7365722e707567782e6f72672f6c656f676f70616c2f6c61726176656c2d73746172746572637275642f76657273696f6e)](https://packagist.org/packages/leogopal/laravel-startercrud)[![Total Downloads](https://camo.githubusercontent.com/b9b98ad01b54ae0e5dae9560ee5fed7b7c9e0b006b9e87e5924cb497f2980924/68747470733a2f2f706f7365722e707567782e6f72672f6c656f676f70616c2f6c61726176656c2d73746172746572637275642f646f776e6c6f616473)](https://packagist.org/packages/leogopal/laravel-startercrud)[![License](https://camo.githubusercontent.com/84ee84b1ce618e7886d50dd711d799ed5e7e259d1c5913ee6d0c1cd658965de4/68747470733a2f2f706f7365722e707567782e6f72672f6c656f676f70616c2f6c61726176656c2d73746172746572637275642f6c6963656e7365)](https://packagist.org/packages/leogopal/laravel-startercrud)

This is an Artisan based package for the [Laravel Starterkit](https://github.com/leogopal/laravel-starterkit)

Install
-------

[](#install)

Via Composer

```
$ composer require leogopal/laravel-startercrud
```

Usage
-----

[](#usage)

Creates a Model, Controller (with Repository, validation Requests, Events and Listeners), Migration, Routes, Breadcrumbs and CRUD Views for the given name ready to work.

It does not overwrite any files that may exist with the pre-stablished names. So, if you delete one of the files and run the command again, the deleted file will be created again and the rest will be ignored and will keep the changes you could have made.

Run
---

[](#run)

In your Laravel project root folder:

```
php artisan lg:crud example

```

Where *example* is the name you want for your model (routes, views, controllers,...). I've tried to follow best naming practices and it uses plural or singular names and lower or uppercase where needed. You can also use camelCase or snake\_case.

Parameters *example*, *Example*, *examples* or *EXAMPLES* all give the same results.

Then run the created migration:

```
php artisan migrate

```

In your browser open:

```
https://YOUR_SITE/admin/examples

```

**...et voilà! :)**

Note: out of the box, the table comes only with a *title* text field, besides the *id*, *deleted\_at*, *created\_at* and *updated\_at*. Edit your newly created migration file to add any other you may need before runnning the migrate command.

Options
-------

[](#options)

You can create all the files and run the migration by running the command with the --migrate option:

```
php artisan lg:crud example --migrate

or

php artisan lg:crud example -m

```

You may also specify the name of the default text field 'title' to whatever other you prefer with the --field option:

```
php artisan lg:crud example --field=name

or

php artisan lg:crud example -f name

```

Include a menu item
-------------------

[](#include-a-menu-item)

A file named *sidebar-examples.blade.php* is created in the folder */resources/views/backend/example/includes*. It contains the html code for a menu item to access your recently created views. You can show it in your sidebar by including the following line in */resources/views/backend/includes/sidebar.blade.php* wherever you want it to appear:

```
@include('backend.example.includes.sidebar-examples')

```

Events and Listeners
--------------------

[](#events-and-listeners)

The package generates three events and listeners for creating, updating and deleting items methods. In order to get these to work you must resgister them with the event dispatcher, adding this line to your *Providers/EventServiceProvider.php* file (under *Backend Subscribers*):

```
\App\Listeners\Backend\Example\ExampleEventListener::class

```

Language lines
--------------

[](#language-lines)

Following are the *labels.php*, *menus.php* and *validation.php* English language lines needed, copy them into the files in */resources/lang/en* or whatever other language folder you may need. Replace *Example* for the name of your Model.

TODO: generate a file with all the customized language lines ready to copy&amp;paste.

**labels.php** under *'backend'*:

```
'examples' => [
    'management'    => 'Example Management',
    'active'        => 'Active Examples',
    'view'          => 'View Example',
    'edit'          => 'Edit Example',
    'create'        => 'Create Example',
    'create_new'    => 'Create New Example',
    'table'         => [
        'title'         => 'Title',
        'created'       => 'Created',
        'last_updated'  => 'Last Updated',
        'deleted'       => 'Deleted',
        'actions'       => 'Actions',
        'tab_title'     => 'Overview',
        'total'         => 'example total|examples total',
    ],

    'tabs' => [
        'title' => 'Overview',
        'content' => [
            'overview'  => [
                'title'         => 'Title',
                'created_at'    => 'Created',
                'last_updated'  => 'Last Updated',
            ],
        ],
    ],

],

_Warning: If you have used the --field option, you should change tabs->content->overview->title to match the field name you have chosen._

```

**menus.php** under *'backend'*

```
'examples' => [
    'main'            => 'Examples',
    'all'             => 'All Examples',
    'create'          => 'Create Example',
    'deleted'         => 'Deleted Examples',
    'view'            => 'View Example',
    'edit'            => 'Edit Example',
],

```

**menus.php** under *'backend' =&gt; 'sidebar'*

```
'examples'  => 'Examples',

```

**validation.php** under *'attributes' =&gt; 'backend'*

```
'examples' => [
    'title'            => 'Title',
],

_Warning: If you have used the --field option, you should change 'title' to match the field name you have chosen.

```

**alerts.php** under *'backend'*

```
'examples' => [
    'created'                   => 'The example was successfully created.',
    'updated'                   => 'The example was successfully updated.',
    'deleted'                   => 'The example was successfully deleted.',
    'restored'                  => 'The example was successfully restored.',
    'deleted_permanently'       => 'The example was deleted permanently.',
],

```

**buttons.php** under *'backend'*

```
'examples' => [
    'restore' => 'Restore Example',
    'delete_permanently'    => 'Permanently delete Example',
],

```

**exceptions.php** under *'backend'*

```
'examples' => [
    'cant_restore'          => 'This Example is not deleted so it can not be restored.',
    'delete_first'          => 'This Example must be deleted first before it can be destroyed permanently.',
]

```

Files created
-------------

[](#files-created)

### Model

[](#model)

```
app/Models/Example.php

```

### Trait Attribute

[](#trait-attribute)

```
app/Models/Traits/Attribute/ExampleAttribute.php

```

This is where the action buttons for the new object are.

### Controller

[](#controller)

```
app/Http/Controllers/Backend/ExampleController.php

```

It contains the CRUD methods: *index*, *create*, *store*, *show*, *edit*, *update*, *destroy*, *delete*, *restore* and *deleted*.

### Repository

[](#repository)

```
app/Repositories/Backend/ExampleRepository.php

```

Contains database logic.

### Requests

[](#requests)

```
app/Http/Requests/Backend/ManageExampleRequest.php
app/Http/Requests/Backend/StoreExampleRequest.php
app/Http/Requests/Backend/UpdateExampleRequest.php

```

Validation manage, store and update Requests.

### Events

[](#events)

```
app/Events/Backend/Example/ExampleCreated.php
app/Events/Backend/Example/ExampleUpdated.php
app/Events/Backend/Example/ExampleDeleted.php

```

### Listeners

[](#listeners)

```
app/Listeners/Backend/Example/ExampleEventListener.php

```

### Migrations

[](#migrations)

```
database/migrations/\YYYY_MM_DD_create_examples_table.php

```

### Routes

[](#routes)

```
routes/backend/examples.php

```

Contains the named routes *admin.examples.index*, *admin.examples.deleted*, *admin.examples.restore*, *delete-permanently*, *admin.examples.create*, *admin.examples.store*, *admin.examples.show*, *admin.examples.edit*, *admin.examples.update* and *admin.examples.destroy*.

### Breadcrumbs

[](#breadcrumbs)

```
routes/breadcrumbs/backend/example.php

```

This has the breadcrumbs for the routes *admin.examples.index*, *admin.examples.create*, *admin.examples.show*, *admin.examples.edit* and *admin.examples.deleted*.

The following line is added to *routes/breadcrumbs/backend/backend.php*:

```
require **DIR**.'/example.php';

```

If you delete the *routes/breadcrumbs/backend/example.php* file created by this command, don't forget to delete this line or your whole project will crash.

### Views

[](#views)

```
resources/views/backend/example/index.blade.php
resources/views/backend/example/show.blade.php
resources/views/backend/example/create.blade.php
resources/views/backend/example/edit.blade.php
resources/views/backend/example/deleted.blade.php
resources/views/backend/example/includes/breadcrumb-links.blade.php
resources/views/backend/example/includes/header-buttons.blade.php

```

If you add more fields to your datatable, you'll have to edit *show.blade.php*, *create.blade.php* and *edit.blade.php* to suit your needs.

### Menu item

[](#menu-item)

```
sidebar-examples.blade.php

```

HTML code for the menu item for your Laravel 5 starterkit sidebar.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

2606d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b96b0d15a783789395cdef44e063be01558ee823a2cb8814aeaab245ba33a6cd?d=identicon)[leogopal](/maintainers/leogopal)

---

Top Contributors

[![leogopal](https://avatars.githubusercontent.com/u/4948323?v=4)](https://github.com/leogopal "leogopal (9 commits)")

---

Tags

laravelleogopallaravel-startercrud

### Embed Badge

![Health badge](/badges/leogopal-laravel-startercrud/health.svg)

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

###  Alternatives

[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[hemp/presenter

Easy Model Presenters in Laravel

247592.6k1](/packages/hemp-presenter)[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)

PHPackages © 2026

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