enable registration

This commit is contained in:
Benjamin Takats
2022-11-30 23:26:27 +01:00
parent f12db8f4ad
commit b6d94132dc
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 = [