Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/SignupController.php
Show First 20 Lines • Show All 309 Lines • ▼ Show 20 Lines | public function signup(Request $request) | ||||
$domain = null; | $domain = null; | ||||
DB::beginTransaction(); | DB::beginTransaction(); | ||||
// Create domain record | // Create domain record | ||||
if ($is_domain) { | if ($is_domain) { | ||||
$domain = Domain::create([ | $domain = Domain::create([ | ||||
'namespace' => $domain_name, | 'namespace' => $domain_name, | ||||
'status' => Domain::STATUS_NEW, | |||||
mollekopf: Why is this change required? Is it just unrelated cleanup? | |||||
Done Inline ActionsYes, it's unrelated cleanup. That's the only place in the controllers where we set NEW status, so for consistency I removed it. The NEW status is being set by observers. machniak: Yes, it's unrelated cleanup. That's the only place in the controllers where we set NEW status… | |||||
'type' => Domain::TYPE_EXTERNAL, | 'type' => Domain::TYPE_EXTERNAL, | ||||
]); | ]); | ||||
} | } | ||||
// Create user record | // Create user record | ||||
$user = User::create([ | $user = User::create([ | ||||
'email' => $login . '@' . $domain_name, | 'email' => $login . '@' . $domain_name, | ||||
'password' => $request->password, | 'password' => $request->password, | ||||
'status' => User::STATUS_RESTRICTED, | |||||
]); | ]); | ||||
if (!empty($discount)) { | if (!empty($discount)) { | ||||
$wallet = $user->wallets()->first(); | $wallet = $user->wallets()->first(); | ||||
$wallet->discount()->associate($discount); | $wallet->discount()->associate($discount); | ||||
$wallet->save(); | $wallet->save(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |
Why is this change required? Is it just unrelated cleanup?