diff --git a/flexiapi/app/Account.php b/flexiapi/app/Account.php index 82514f4..1fb54df 100644 --- a/flexiapi/app/Account.php +++ b/flexiapi/app/Account.php @@ -441,7 +441,7 @@ class Account extends Authenticatable return !empty($this->recovery_code) && $this->updated_at->greaterThan($oneHourAgo); } - public function updatePassword($newPassword, ?string $algorithm = null) + public function updatePassword(string $newPassword, ?string $algorithm = null) { $algorithm = $algorithm ?? config('app.account_default_password_algorithm'); diff --git a/flexiapi/app/Http/Controllers/Admin/AccountController.php b/flexiapi/app/Http/Controllers/Admin/AccountController.php index 80f1482..39f2371 100644 --- a/flexiapi/app/Http/Controllers/Admin/AccountController.php +++ b/flexiapi/app/Http/Controllers/Admin/AccountController.php @@ -136,7 +136,10 @@ class AccountController extends Controller $account->phone = $request->get('phone'); - $account->updatePassword($request->get('password')); + if ($request->get('password')) { + $account->updatePassword($request->get('password')); + } + $account->setRole($request->get('role')); Log::channel('events')->info('Web Admin: Account updated', ['id' => $account->identifier]); diff --git a/flexiapi/resources/views/admin/account/create_edit.blade.php b/flexiapi/resources/views/admin/account/create_edit.blade.php index d97544f..0428825 100644 --- a/flexiapi/resources/views/admin/account/create_edit.blade.php +++ b/flexiapi/resources/views/admin/account/create_edit.blade.php @@ -2,8 +2,12 @@ @section('breadcrumb') @include('admin.account.parts.breadcrumb_accounts_index') - @include('admin.account.parts.breadcrumb_accounts_edit', ['account' => $account]) - + @if ($account->id) + @include('admin.account.parts.breadcrumb_accounts_edit', ['account' => $account]) + + @else + + @endif @endsection @section('content')