Skip to content

Commit

Permalink
Fix contact creation on PostgreSQL (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
simhnna authored and djaiss committed Dec 13, 2017
1 parent 3bc5757 commit 3738695
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,19 @@ protected function validator(array $data)
*/
protected function create(array $data)
{
// create a new account
$account = new Account;
$account->api_key = str_random(30);
$account->created_at = Carbon::now();
$account->save();

$user = new User;
$user->first_name = $data['first_name'];
$user->last_name = $data['last_name'];
$user->email = $data['email'];
$user->password = bcrypt($data['password']);
$user->timezone = config('app.timezone');
$user->created_at = Carbon::now();
$user->save();

// create a new account
$account = new Account;
$account->api_key = str_random(30);
$account->created_at = Carbon::now();
$account->save();

$user->account_id = $account->id;
$user->save();

Expand Down

0 comments on commit 3738695

Please sign in to comment.