File tree 1 file changed +6
-7
lines changed
stubs/app/Http/Livewire/Admin/Users/Edit
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ class AdminSettings extends Base
24
24
25
25
public function mount (): void
26
26
{
27
- $ this ->isActive = (int ) $ this ->user ->is_active ;
28
- $ this ->isOfficeLoginOnly = (int ) $ this ->user ->is_office_login_only ;
27
+ $ this ->isActive = (bool ) $ this ->user ->is_active ;
28
+ $ this ->isOfficeLoginOnly = (bool ) $ this ->user ->is_office_login_only ;
29
29
}
30
30
31
31
public function render (): View
@@ -38,8 +38,8 @@ public function render(): View
38
38
protected function rules (): array
39
39
{
40
40
return [
41
- 'isOfficeLoginOnly ' => 'integer ' ,
42
- 'isActive ' => 'integer '
41
+ 'isOfficeLoginOnly ' => 'bool ' ,
42
+ 'isActive ' => 'bool '
43
43
];
44
44
}
45
45
@@ -58,6 +58,7 @@ public function update(): void
58
58
if (is_admin ()) {
59
59
$ this ->user ->is_office_login_only = $ this ->isOfficeLoginOnly ? 1 : 0 ;
60
60
$ this ->user ->is_active = $ this ->isActive ? 1 : 0 ;
61
+ $ this ->user ->save ();
61
62
62
63
add_user_log ([
63
64
'title ' => "updated " .$ this ->user ->name ."'s admin settings " ,
@@ -68,9 +69,7 @@ public function update(): void
68
69
]);
69
70
}
70
71
71
- $ this ->user ->save ();
72
-
73
- flash ('App Settings Updated! ' )->success ();
72
+ flash ('Settings Updated! ' )->success ();
74
73
$ this ->emit ('refreshProfile ' );
75
74
}
76
75
}
You can’t perform that action at this time.
0 commit comments