MakeModelCommand class

Creates a model under lib/app/models, optionally with its migration (-m), factory (-f) and API resource (-r).

--fields "title:string published:bool" is the reason this command exists: it writes the declared field, the constructor parameter, the fromMap read, the toMap write, the cast entry and the fillable entry from one source, so they cannot disagree.

Constructors

MakeModelCommand()

Properties

app ↔ Application
latefinalinherited
description String
no setter
directory String
Directory relative to the app root, e.g. lib/app/http/controllers.
no setter
err StringSink
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
name String
no setter
out StringSink
getter/setter pairinherited
parsedSignature ↔ Signature
getter/setter pairinherited
rest List<String>
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signature String
no setter
type String
Human label, e.g. Controller.
no setter

Methods

argument(String name) String?
inherited
bind(List<String> args) → void
Bind parsed input. Throws FormatException on bad input.
inherited
error(String message) → void
inherited
flag(String name) bool
inherited
handle() Future<int>
info(String message) → void
inherited
line(String message) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
option(String name) String?
inherited
stub(String className) String
table(List<String> headers, List<List<String>> rows) → void
inherited
toString() String
A string representation of this object.
inherited
warn(String message) → void
inherited
writeGenerated(String relative, String contents) → void
Writes contents to the application-relative relative, then hands the file to dart format.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited