Skip to content

Instantly share code, notes, and snippets.

@raank
Created March 8, 2017 10:59
Show Gist options
  • Save raank/9e6a1ae779ec154755701944223c62f9 to your computer and use it in GitHub Desktop.
Save raank/9e6a1ae779ec154755701944223c62f9 to your computer and use it in GitHub Desktop.
<?php
// create user
$user = new \App\User();
$user->name = 'teste';
$user->email = '[email protected]';
$user->password = bcrypt('teste');
$user->save();
// create voter for user
$voter = new \App\Voter();
$voter->user_id = $user->id;
$voter->nickname = 'teste';
$voter->genre = 1; // 1 to masc or 0 to fem
$voter->birth = '2017-03-08';
$voter->observations = 'teste';
$voter->save();
// create education for voter
$education = $voter->education()->create(['education' => 'Superior completo']);
dd( $education );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment