Package Usage
Last updated
Last updated
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 !
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.
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 :
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.
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 :
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