Created
April 13, 2014 10:33
-
-
Save robinmitra/10578271 to your computer and use it in GitHub Desktop.
Cheatsheet for Jeffrey Way's Laravel Generators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Migration | |
# Create a migration to create a table named 'posts' | |
php artisan generate:migration create_posts_table | |
# Create a migration to add a field named 'user_id' to the 'posts' table | |
php artisan generate:migration add_user_id_to_posts_table | |
# Create a migration to remove the 'user_id' field we just created | |
php artisan generate:reomve_user_id_from_posts_table | |
# Create a migration to delete the 'posts' table we just created | |
php artisan generate:migration delete_posts_table | |
# Create a migration to create a table named 'posts' and also generate the schema for a number of fields | |
php artisan generate:migration create_posts_table --fields="title:string, body:text, age:integer:nullable:default(18), username:string(30):unique" | |
# Create a migration to remove the 'age' field we just created | |
php artisan generate:reomve_age_from_posts_table --fields="age" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wow, thanks for this!