@@ -31,12 +31,12 @@ |
||
| 31 | 31 | * |
| 32 | 32 | * @return void |
| 33 | 33 | */ |
| 34 | - public function __construct(Company $tenant, $name='', $email='', $password='') |
|
| 34 | + public function __construct(Company $tenant, $name = '', $email = '', $password = '') |
|
| 35 | 35 | { |
| 36 | 36 | // |
| 37 | 37 | $this->tenant = $tenant; |
| 38 | 38 | $this->name = $name; |
| 39 | - $this->email= $email; |
|
| 39 | + $this->email = $email; |
|
| 40 | 40 | $this->password = $password; |
| 41 | 41 | // $this->queue = 'sync'; |
| 42 | 42 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | { |
| 10 | 10 | public static function set($user, $tenant) |
| 11 | 11 | { |
| 12 | - if ( $tenant) { |
|
| 12 | + if ($tenant) { |
|
| 13 | 13 | self::connection(Connections::Tenant); |
| 14 | 14 | } else { |
| 15 | 15 | self::connection('mysql'); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | \DB::purge('mysql'); |
| 24 | 24 | \DB::reconnect('mysql'); |
| 25 | 25 | |
| 26 | - if (! $request->user()) { |
|
| 26 | + if (!$request->user()) { |
|
| 27 | 27 | return $next($request); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | protected function create(array $data) |
| 46 | 46 | { |
| 47 | - try{ |
|
| 47 | + try { |
|
| 48 | 48 | DB::beginTransaction(); |
| 49 | 49 | // create person |
| 50 | 50 | $person = new Person(); |
@@ -53,15 +53,15 @@ discard block |
||
| 53 | 53 | $person->save(); |
| 54 | 54 | |
| 55 | 55 | // get user_group_id |
| 56 | - $user_group = UserGroup::where('name','Administrators')->first(); |
|
| 57 | - if($user_group == null) { |
|
| 56 | + $user_group = UserGroup::where('name', 'Administrators')->first(); |
|
| 57 | + if ($user_group == null) { |
|
| 58 | 58 | // create user_group |
| 59 | 59 | $user_group = UserGroup::create(['name'=>'Administrators', 'description'=>'Administrator users group']); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // get role_id |
| 63 | 63 | $role = Role::where('name', 'supervisor')->first(); |
| 64 | - if($role == null) { |
|
| 64 | + if ($role == null) { |
|
| 65 | 65 | $role = Role::create(['menu_id'=>1, 'name'=>'supervisor', 'display_name'=>'Supervisor', 'description'=>'Supervisor role.']); |
| 66 | 66 | } |
| 67 | 67 | $user = User::create([ |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | return $user; |
| 99 | - }catch(\Exception $e){ |
|
| 99 | + } catch (\Exception $e) { |
|
| 100 | 100 | DB::rollBack(); |
| 101 | 101 | throw $e; |
| 102 | 102 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | $user = $this->loggableUser($request); |
| 57 | 57 | |
| 58 | - if (! $user) { |
|
| 58 | + if (!$user) { |
|
| 59 | 59 | return false; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $user = User::whereEmail($request->input('email'))->first(); |
| 80 | 80 | $company = $user->company(); |
| 81 | 81 | $tanent = false; |
| 82 | - if($company) { |
|
| 82 | + if ($company) { |
|
| 83 | 83 | $tanent = true; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | // Tenant::set($company); |
| 93 | 93 | $value = Connections::Tenant.$company->id; |
| 94 | 94 | |
| 95 | - }else{ |
|
| 95 | + } else { |
|
| 96 | 96 | $value = ''; |
| 97 | 97 | |
| 98 | 98 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | \Session::put('db', $value); |
| 107 | 107 | |
| 108 | - if (! optional($user)->currentPasswordIs($request->input('password'))) { |
|
| 108 | + if (!optional($user)->currentPasswordIs($request->input('password'))) { |
|
| 109 | 109 | return; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -31,25 +31,25 @@ |
||
| 31 | 31 | |
| 32 | 32 | public function boot() |
| 33 | 33 | { |
| 34 | - $this->app->bind(ValidatePersonStore::class, function () { |
|
| 34 | + $this->app->bind(ValidatePersonStore::class, function() { |
|
| 35 | 35 | return new LocalPersonStore(); |
| 36 | 36 | }); |
| 37 | - $this->app->bind(ValidatePersonUpdate::class, function () { |
|
| 37 | + $this->app->bind(ValidatePersonUpdate::class, function() { |
|
| 38 | 38 | return new LocalPersonUpdate(); |
| 39 | 39 | }); |
| 40 | - $this->app->bind(ValidatePersonRequest::class, function () { |
|
| 40 | + $this->app->bind(ValidatePersonRequest::class, function() { |
|
| 41 | 41 | return new LocalPersonRequest(); |
| 42 | 42 | }); |
| 43 | - $this->app->bind(EnsoPerson::class, function () { |
|
| 43 | + $this->app->bind(EnsoPerson::class, function() { |
|
| 44 | 44 | return new LocalPerson(); |
| 45 | 45 | }); |
| 46 | - $this->app->bind(Person::class, function () { |
|
| 46 | + $this->app->bind(Person::class, function() { |
|
| 47 | 47 | return new LocalPerson(); |
| 48 | 48 | }); |
| 49 | - $this->app->bind(PersonTable::class, function () { |
|
| 49 | + $this->app->bind(PersonTable::class, function() { |
|
| 50 | 50 | return new LocalPersonTable(); |
| 51 | 51 | }); |
| 52 | - $this->app->bind(PersonForm::class, function () { |
|
| 52 | + $this->app->bind(PersonForm::class, function() { |
|
| 53 | 53 | return new LocalPersonForm(); |
| 54 | 54 | }); |
| 55 | 55 | } |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function closure(): Closure |
| 17 | 17 | { |
| 18 | - return fn () => $this->morphMany(Discussion::class, 'discussable'); |
|
| 18 | + return fn() => $this->morphMany(Discussion::class, 'discussable'); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -16,6 +16,6 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function closure(): Closure |
| 18 | 18 | { |
| 19 | - return fn () => $this->morphMany(Document::class, 'documentable'); |
|
| 19 | + return fn() => $this->morphMany(Document::class, 'documentable'); |
|
| 20 | 20 | } |
| 21 | 21 | } |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function closure(): Closure |
| 17 | 17 | { |
| 18 | - return fn () => $this->morphMany(Comment::class, 'commentable'); |
|
| 18 | + return fn() => $this->morphMany(Comment::class, 'commentable'); |
|
| 19 | 19 | } |
| 20 | 20 | } |