As per Blueprint's README:
Blueprint is an open-source tool for rapidly generating multiple Laravel components from a single, human readable definition.
This add-on will read your existing database schema and create a Blueprint draft file based on said schema. It's ultimate goal is to port existing (legacy) projects to the Laravel framework with as little effort as possible.
As per the Laravel documentation the following column types are supported.
-
bigIncrements
-
bigInteger
-
binary
-
boolean
-
char
-
date
-
dateTime
-
dateTimeTz
Due to limitations it's rendered asdateTime
-
decimal
-
double
-
enum
-
float
-
geometry
-
geometryCollection
-
increments
-
integer
-
ipAddress
Rendered asstring
-
json
-
jsonb
Rendered asjson
-
lineString
Due to limitations in DBAL it's not supported -
longText
-
macAddress
Rendered asstring
-
mediumIncrements
-
mediumInteger
-
mediumText
-
morphs
-
uuidMorphs
-
multiLineString
-
multiPoint
-
multiPolygon
-
nullableMorphs
-
nullableUuidMorphs
-
point
-
polygon
-
set
-
smallIncrements
-
smallInteger
-
string
-
text
-
time
-
timeTz
Due to limitations it's rendered astime
-
timestamp
-
timestampTz
-
tinyIncrements
Rendered asboolean
-
tinyInteger
Rendered asboolean
-
unsignedBigInteger
Rendered asbiginteger unsigned
-
unsignedDecimal
-
unsignedInteger
Rendered asinteger unsigned
-
unsignedMediumInteger
Rendered asinteger unsigned
-
unsignedSmallInteger
Rendered assmallinteger unsigned
-
unsignedTinyInteger
Rendered asboolean unsigned
-
uuid
Rendered asstring
-
year
Rendered asdate
-
id
SeebigIncrements
-
foreignId
SeeunsignedBigInteger
-
nullableTimestamps
Seetimestamp
-
timestamps
Seetimestamps
-
timestampsTz
Seetimestamp
-
softDeletes
Seetimestamp
-
softDeletesTz
SeetimestampTz
-
rememberToken
- autoIncrement
- charset
- collation
- default
- nullable
- unsigned
- useCurrent
- always
- unique
- index
- primary
- foreign
CREATE TABLE `posts` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(400) NOT NULL,
`content` longtext NOT NULL,
`published_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
This YAML has been taken from Blueprint's README.
models:
Post:
title: string:400
content: longtext
published_at: nullable timestamp
CREATE TABLE `users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `posts` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(400) NOT NULL,
`content` longtext NOT NULL,
`published_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `comments` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`author_id` bigint(20) unsigned NOT NULL,
`post_id` bigint(20) unsigned NOT NULL,
`content` longtext NOT NULL,
`published_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `comments_author_id_foreign` (`author_id`),
KEY `comments_post_id_foreign` (`post_id`),
CONSTRAINT `comments_author_id_foreign` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`),
CONSTRAINT `comments_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
models:
User:
name: string
timestamps
Post:
title: string:400
content: longtext
published_at: nullable timestamp
Comment:
author_id: id:user
post_id: id
content: longtext
published_at: nullable timestamp