I have added the ability to add relationships. So now you can type
Book belongsTo Author title:string published:year
and it will generate your Book model with method author, and also will allow you to create the Author model with a "hasOne" or "hasMany" relationship back. It also automatically adds the author_id
attribute to the migration. To add the Author, you can type:
Author hasMany Book name:string address:string
and this will create the books method on Author and assign author_id as a foreign key to Author.
Next I am going to implement "Faker" so that you have the ability to add in fake data to test your application. This may be a bit tricky with relationships because of foreign key issues and such, but I'm sure I will think of a way to do this.
I am excited about the possibilities of this command and I hope that you all check it out to give some feedback and, ya know, code faster.
Sorry for all of the posts... but I have now added in Faker support. The default is to attempt to choose a Faker type based off of the properties you supply and seed 10 rows in the database with that data. However, this doesn't yet fill in foreign keys appropriately (assigning foreign keys may still be a bit buggy).
Some things I'm hoping to implement:
Just view your github recently. I was wondering:
My starter command does all of that, plus:
Starts your application from scratch. It will create your layout file for you, download bootstrap and your javascript files for you, and add them to the new layout file.
Sets up relationships. So you can run "Book belongsTo Author title:string" and it will automatically set up that relationship in the model and in the migration. It will even set up the foreign keys for you when seeding.
Namespacing - Who doesn't use this on any decent sized application?
Integrates with Faker to automatically seed mock data for you
Sets up the repository pattern. This makes your application much more testable and really is what you should be doing for any real world project.
Creates basic tests. It sets up controller tests.
I also have some cool future ideas such as scaffolding javascript framework files.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community