Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // create user
- $user = new \App\User();
- $user->name = 'teste';
- $user->email = 'email@teste.com';
- $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 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement