disable actions

This commit is contained in:
Benjamin Takats
2022-11-30 17:32:43 +01:00
parent 16f4498ddc
commit bea98711db
7 changed files with 29 additions and 21 deletions

View File

@@ -18,21 +18,25 @@ class CreateNewUser implements CreatesNewUsers
* Create a newly registered user.
*
* @param array $input
*
* @return \App\Models\User
*/
public function create(array $input)
{
abort('404', 'WIP');
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => $this->passwordRules(),
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
])->validate();
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
])
->validate();
return DB::transaction(function () use ($input) {
return tap(User::create([
'name' => $input['name'],
'email' => $input['email'],
'name' => $input['name'],
'email' => $input['email'],
'password' => Hash::make($input['password']),
]), function (User $user) {
$this->createTeam($user);
@@ -44,14 +48,16 @@ class CreateNewUser implements CreatesNewUsers
* Create a personal team for the user.
*
* @param \App\Models\User $user
*
* @return void
*/
protected function createTeam(User $user)
{
$user->ownedTeams()->save(Team::forceCreate([
'user_id' => $user->id,
'name' => explode(' ', $user->name, 2)[0]."'s Team",
'personal_team' => true,
]));
$user->ownedTeams()
->save(Team::forceCreate([
'user_id' => $user->id,
'name' => explode(' ', $user->name, 2)[0]."'s Team",
'personal_team' => true,
]));
}
}

View File

@@ -19,12 +19,14 @@
<x-jet-label for="email" value="{{ __('Email') }}"/>
<x-jet-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')"
required autofocus/>
admin@einundzwanzig.space
</div>
<div class="mt-4">
<x-jet-label for="password" value="{{ __('Password') }}"/>
<x-jet-input id="password" class="block mt-1 w-full" type="password" name="password" required
autocomplete="current-password"/>
1234
</div>
<div class="block mt-4">

View File

@@ -43,9 +43,9 @@
{{ __('Cancel') }}
</x-jet-secondary-button>
<x-jet-danger-button class="ml-3" wire:click="deleteUser" wire:loading.attr="disabled">
{{--<x-jet-danger-button class="ml-3" wire:click="deleteUser" wire:loading.attr="disabled">
{{ __('Delete Account') }}
</x-jet-danger-button>
</x-jet-danger-button>--}}
</x-slot>
</x-jet-dialog-modal>
</x-slot>

View File

@@ -86,11 +86,11 @@
{{ __('Cancel') }}
</x-jet-secondary-button>
<x-jet-button class="ml-3"
{{--<x-jet-button class="ml-3"
wire:click="logoutOtherBrowserSessions"
wire:loading.attr="disabled">
{{ __('Log Out Other Browser Sessions') }}
</x-jet-button>
</x-jet-button>--}}
</x-slot>
</x-jet-dialog-modal>
</x-slot>

View File

@@ -79,9 +79,9 @@
<div class="mt-5">
@if (! $this->enabled)
<x-jet-confirms-password wire:then="enableTwoFactorAuthentication">
<x-jet-button type="button" wire:loading.attr="disabled">
{{--<x-jet-button type="button" wire:loading.attr="disabled">
{{ __('Enable') }}
</x-jet-button>
</x-jet-button>--}}
</x-jet-confirms-password>
@else
@if ($showingRecoveryCodes)

View File

@@ -32,8 +32,8 @@
{{ __('Saved.') }}
</x-jet-action-message>
<x-jet-button>
{{--<x-jet-button>
{{ __('Save') }}
</x-jet-button>
</x-jet-button>--}}
</x-slot>
</x-jet-form-section>

View File

@@ -88,8 +88,8 @@
{{ __('Saved.') }}
</x-jet-action-message>
<x-jet-button wire:loading.attr="disabled" wire:target="photo">
{{--<x-jet-button wire:loading.attr="disabled" wire:target="photo">
{{ __('Save') }}
</x-jet-button>
</x-jet-button>--}}
</x-slot>
</x-jet-form-section>