File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
stubs/app/Http/Livewire/Admin/Users/Edit Expand file tree Collapse file tree 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
2424
2525 public function mount (): void
2626 {
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 ;
2929 }
3030
3131 public function render (): View
@@ -38,8 +38,8 @@ public function render(): View
3838 protected function rules (): array
3939 {
4040 return [
41- 'isOfficeLoginOnly ' => 'integer ' ,
42- 'isActive ' => 'integer '
41+ 'isOfficeLoginOnly ' => 'bool ' ,
42+ 'isActive ' => 'bool '
4343 ];
4444 }
4545
@@ -58,6 +58,7 @@ public function update(): void
5858 if (is_admin ()) {
5959 $ this ->user ->is_office_login_only = $ this ->isOfficeLoginOnly ? 1 : 0 ;
6060 $ this ->user ->is_active = $ this ->isActive ? 1 : 0 ;
61+ $ this ->user ->save ();
6162
6263 add_user_log ([
6364 'title ' => "updated " .$ this ->user ->name ."'s admin settings " ,
@@ -68,9 +69,7 @@ public function update(): void
6869 ]);
6970 }
7071
71- $ this ->user ->save ();
72-
73- flash ('App Settings Updated! ' )->success ();
72+ flash ('Settings Updated! ' )->success ();
7473 $ this ->emit ('refreshProfile ' );
7574 }
7675}
You can’t perform that action at this time.
0 commit comments