Skip to content

Instantly share code, notes, and snippets.

@terion-name
Last active August 29, 2015 13:59
Show Gist options
  • Save terion-name/10640852 to your computer and use it in GitHub Desktop.
Save terion-name/10640852 to your computer and use it in GitHub Desktop.
#User scaffolding
php artisan generate:scaffold user --fields="email:string:nullable:unique, password:string:nullable, first_name:string:nullable, last_name:string:nullable, gender:string(16):nullable:default('male'), birthday:date:nullable"
#Social accounts
php artisan generate:migration create_socials_table --fields="user_id:integer:unsigned, soc_uid:string, provider:string(8), user_id:foreign:references('id'):on('users'):onDelete('cascade')"
php artisan generate:model Social
#Social wall posts
php artisan generate:migration create_social_posts_table --fields="user_id:integer:unsigned:nullable, post_id:string, provider:string(8):default('fb'), user_id:foreign:references('id'):on('users'):onDelete('set null')"
php artisan generate:model SocialPost
#Social invites
php artisan generate:migration create_social_invites_table --fields="user_id:integer:unsigned:nullable, invited_id:integer:unsigned:nullable, invite_id:string, provider:string(8):default('fb'), user_id:foreign:references('id'):on('users'):onDelete('set null'), invited_id:foreign:references('id'):on('users'):onDelete('set null')"
php artisan generate:model SocialInvite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment