Package Usage
Generating Dashboard
To generate dashboard you need to simply below command.
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'
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
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
Generate CRUD CommandGenerating 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:
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.
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 API CommandLast updated