sayeed/crud-from-db

Crud Generator From Database Schema

3.0.7 2021-08-05 05:40 UTC

This package is auto-updated.

Last update: 2024-12-05 13:12:29 UTC


README

Laravel CRUD generator will help you to generate CRUD direct from database schema.

Installation

You can install the package via composer:

composer require sayeed/crud-from-db

Laravel 5.5 and above

The package will automatically register itself, so you can start using it immediately.

Laravel 5.4 and older

In Laravel version 5.4 and older, you have to add your new provider to the providers array of config/app.php:

'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    Sayeed\CrudFromDb\CrudFromDbServiceProvider::class,
];

Add two class aliases to the aliases array of config/app.php

'aliases' => [
    // ...
    'Form' => Collective\Html\FormFacade::class,
    'Html' => Collective\Html\HtmlFacade::class,
];

Usage

After installing the package, you will now see a new php artisan crud:custom command.

CRUD using specific model name

You can generate CRUD from a specific table using table model name:

php artisan crud:custom -m article

Alternatively, you can use the longform version:

php artisan crud:custom --model=article

CRUD useing specific connection name

You can generate CRUD from specific database connection, default connection mysql:

php artisan crud:custom -c mysql

Alternatively, you can use the longform version:

php artisan crud:custom --connection=mysql

CRUD with auth middleware

You can generate CRUD with auth middleware:

php artisan crud:custom -a

Alternatively, you can use the longform version:

php artisan crud:custom --auth

CRUD with forcefully overwrite

You can generate CRUD with forcefully overwritten existing file:

php artisan crud:custom -f

Alternatively, you can use the longform version:

php artisan crud:custom --force

CRUD skip some table

You can generate CRUD without some specific table:

php artisan crud:custom -s table1,table2

Alternatively, you can use the longform version:

php artisan crud:custom --skip=table1,table2

You can pass here table name or model name

CRUD help

CRUD help:

php artisan crud:custom -h

Alternatively, you can use the longform version:

php artisan crud:custom --help

Credits

Thank you for using it.