Crudstarter Docs
  • Introduction
  • Prerequisites
  • Installation
  • Customization via Config
  • Package Usage
  • Generate CRUD Command
  • Generate API Command
  • Components
Powered by GitBook
On this page
  • Generating Dashboard
  • Updating proengsoft/laravel-jsvalidation config
  • Creating CRUD via Command
  • Basic Usage
  • Field Data Type
  • Advance Usage
  • Generating API Command
  • Basic Usage
  • API Options

Package Usage

PreviousCustomization via ConfigNextGenerate CRUD Command

Last updated 11 months ago

Generating Dashboard

To generate dashboard you need to simply below command.

Please note that this is one time command, you only need to execute this command once !

php artisan gen:dashboard

Updating proengsoft/laravel-jsvalidation config

Update the config/jsvalidation.php file in your Laravel project. Change the 'view' option from 'jsvalidation::bootstrap' to 'jsvalidation::bootstrap5'

This configuration change will instruct the package to use the Bootstrap 5 styling for the JavaScript validation error messages and other related UI components.

Creating CRUD via Command

Basic Usage

This is a small introduction of the generate crud command, to fully understand and use this command please visit the Advance usage section.

Let us create a CRUD with Blog Model with fields title (string), slug (string), description (text), image (string), status (boolean). To generate the above Blog crud we will use format of :

php artisan gen:crud Blog --fields="title:str slug:str description:text image:str status:bool"

Field Data Type

some short hands for convenience are provided i.e instead of unsignedInteger we can use uint instead while defining fields

Data type Name
Short Hand For

inc

increments

int

integer

uint

unsignedInteger

tinyint

tinyInteger

utinyint

unsignedTinyInteger

smallint

smallInteger

usmallint

unsignedSmallInteger

mediumint

mediumInteger

umediumint

unsignedMediumInteger

bigint

bigInteger

ubigint

unsignedBigInteger

txt

text

tinytext

tinyText

mediumtext

mediumText

longtext

longText

bool

boolean

fid

foreignId

Note: For other data types like date, enum, decimal, uuid etc can typed as it is.

Advance Usage

Generating API Command

Basic Usage

This is a small introduction of the generate crud command, to fully understand and use this command please visit the Advance usage section.

Let us create a API with Blog Model with fields title (string), slug (string), description (text), image (string), status (boolean). To generate the above Blog crud we will use format of :

php artisan gen:api Blog --fields="title:str slug:str description:text image:str status:bool"

API Options

The CRUD Generator package offers two options for generating APIs:

  1. Generate API with Model and Migration

    • Use when you don't have an existing CRUD or model for the resource.

    • Generates the model, migration, and API routes/controllers in a single command.

  2. Generate API without Model and Migration

    • Use when you already have an existing CRUD and model for the resource.

    • Generates only the API routes and controllers, as the model and migration already exist.

The first option is suitable for creating a new resource from scratch, while the second option allows you to add API functionality to an existing CRUD and model.

More on the API in Generate API section

Generate CRUD Command
Generate API Command
dashboard page
register page
login page