Fix default genders seed with setup:production (#898)
This commit is contained in:
@@ -6,7 +6,6 @@ use Auth;
|
||||
use App\User;
|
||||
use Validator;
|
||||
use App\Account;
|
||||
use Carbon\Carbon;
|
||||
use App\Jobs\SendNewUserAlert;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
@@ -81,24 +80,8 @@ class RegisterController extends Controller
|
||||
*/
|
||||
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->account_id = $account->id;
|
||||
$user->save();
|
||||
|
||||
$account->populateContactFieldTypeTable();
|
||||
$account->populateDefaultGendersTable();
|
||||
$account = Account::createDefault($data['first_name'], $data['last_name'], $data['email'], $data['password']);
|
||||
$user = $account->users()->first();
|
||||
|
||||
// send me an alert
|
||||
dispatch(new SendNewUserAlert($user));
|
||||
|
||||
Reference in New Issue
Block a user