enable registration

This commit is contained in:
Benjamin Takats
2022-11-30 23:26:27 +01:00
parent 61fc940f8f
commit 8769b0bb52
5 changed files with 24 additions and 28 deletions

View File

@@ -23,12 +23,10 @@ class CreateNewUser implements CreatesNewUsers
*/
public function create(array $input)
{
abort('404', 'WIP');
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => $this->passwordRules(),
'password' => app()->environment('local') ? 'required' : $this->passwordRules(),
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
])
->validate();

View File

@@ -8,7 +8,6 @@ trait PasswordValidationRules
{
/**
* Get the validation rules used to validate passwords.
*
* @return array
*/
protected function passwordRules()

View File

@@ -11,7 +11,7 @@ use Laravel\Jetstream\HasProfilePhoto;
use Laravel\Jetstream\HasTeams;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
class User extends Authenticatable implements MustVerifyEmail
{
use HasApiTokens;
use HasFactory;
@@ -22,7 +22,6 @@ class User extends Authenticatable
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
protected $fillable = [
@@ -31,7 +30,6 @@ class User extends Authenticatable
/**
* The attributes that should be hidden for serialization.
*
* @var array
*/
protected $hidden = [
@@ -43,7 +41,6 @@ class User extends Authenticatable
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
@@ -52,7 +49,6 @@ class User extends Authenticatable
/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = [

View File

@@ -1,4 +1,4 @@
<div class="bg-21gray">
<div class="bg-21gray flex flex-col h-screen justify-between">
{{-- HEADER --}}
<section class="w-full">
<div class="max-w-7xl mx-auto px-10">
@@ -115,7 +115,7 @@
</div>
</section>
{{-- FOOTER --}}
<section class="sticky bottom-0 py-10 bg-gray-900 w-full">
<div class="bottom-0 py-6 bg-gray-900 w-full">
<div class="px-10 mx-auto max-w-7xl">
<div class="flex flex-col items-center md:flex-row md:justify-between">
<a href="#_">
@@ -147,5 +147,5 @@
</ul>
</div>
</div>
</section>
</div>
</div>

View File

@@ -28,7 +28,8 @@
<!-- Current Profile Photo -->
<div class="mt-2" x-show="! photoPreview">
<img src="{{ $this->user->profile_photo_url }}" alt="{{ $this->user->name }}" class="rounded-full h-20 w-20 object-cover">
<img src="{{ $this->user->profile_photo_url }}" alt="{{ $this->user->name }}"
class="rounded-full h-20 w-20 object-cover">
</div>
<!-- New Profile Photo Preview -->
@@ -55,7 +56,8 @@
<!-- Name -->
<div class="col-span-6 sm:col-span-4">
<x-jet-label for="name" value="{{ __('Name') }}"/>
<x-jet-input id="name" type="text" class="mt-1 block w-full" wire:model.defer="state.name" autocomplete="name" />
<x-jet-input id="name" type="text" class="mt-1 block w-full" wire:model.defer="state.name"
autocomplete="name"/>
<x-jet-input-error for="name" class="mt-2"/>
</div>
@@ -69,7 +71,8 @@
<p class="text-sm mt-2">
{{ __('Your email address is unverified.') }}
<button type="button" class="underline text-sm text-gray-600 hover:text-gray-900" wire:click.prevent="sendEmailVerification">
<button type="button" class="underline text-sm text-gray-600 hover:text-gray-900"
wire:click.prevent="sendEmailVerification">
{{ __('Click here to re-send the verification email.') }}
</button>
</p>
@@ -88,8 +91,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>