@@ -79,16 +79,16 @@ |
||
| 79 | 79 | 'name' => $data['name'], |
| 80 | 80 | 'email' => $data['email'], |
| 81 | 81 | 'is_active' => 1, |
| 82 | - 'is_tenant' => 1, |
|
| 83 | - 'status' => 1 |
|
| 82 | + 'is_tenant' => 1, |
|
| 83 | + 'status' => 1 |
|
| 84 | 84 | ]); |
| 85 | 85 | |
| 86 | - $company->attachPerson($person->id); |
|
| 86 | + $company->attachPerson($person->id); |
|
| 87 | 87 | |
| 88 | - // Dispatch Tenancy Jobs |
|
| 88 | + // Dispatch Tenancy Jobs |
|
| 89 | 89 | |
| 90 | - CreateDatabase::dispatch($company); |
|
| 91 | - Migrate::dispatch($company); |
|
| 90 | + CreateDatabase::dispatch($company); |
|
| 91 | + Migrate::dispatch($company); |
|
| 92 | 92 | |
| 93 | 93 | return $user; |
| 94 | 94 | }catch(\Exception $e){ |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | protected function create(array $data) |
| 43 | 43 | { |
| 44 | - try{ |
|
| 44 | + try { |
|
| 45 | 45 | DB::beginTransaction(); |
| 46 | 46 | // create person |
| 47 | 47 | $person = new Person(); |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | $person->save(); |
| 50 | 50 | |
| 51 | 51 | // get user_group_id |
| 52 | - $user_group = UserGroup::where('name','User')->first(); |
|
| 53 | - if($user_group == null) { |
|
| 52 | + $user_group = UserGroup::where('name', 'User')->first(); |
|
| 53 | + if ($user_group == null) { |
|
| 54 | 54 | // create user_group |
| 55 | 55 | $user_group = UserGroup::create(['name'=>'User', 'description'=>'This is user group']); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // get role_id |
| 59 | 59 | $role = Role::where('name', 'supervisor')->first(); |
| 60 | - if($role == null) { |
|
| 60 | + if ($role == null) { |
|
| 61 | 61 | $role = Role::create(['menu_id'=>1, 'name'=>'supervisor', 'display_name'=>'User', 'description'=>'This is user']); |
| 62 | 62 | } |
| 63 | 63 | $user = User::create([ |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | Migrate::dispatch($company); |
| 92 | 92 | |
| 93 | 93 | return $user; |
| 94 | - }catch(\Exception $e){ |
|
| 94 | + } catch (\Exception $e) { |
|
| 95 | 95 | DB::rollBack(); |
| 96 | 96 | throw $e; |
| 97 | 97 | } |