Loading app/Actions/Fortify/CreateNewUser.php +2 −2 Original line number Diff line number Diff line Loading @@ -21,14 +21,14 @@ public function create(array $input): User { Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'username' => ['required', 'string', 'max:255', 'min:4', 'unique:users'], 'password' => $this->passwordRules(), 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '', ])->validate(); return User::create([ 'name' => $input['name'], 'email' => $input['email'], 'username' => $input['username'], 'password' => Hash::make($input['password']), ]); } Loading app/Actions/Fortify/UpdateUserProfileInformation.php +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ public function update(User $user, array $input): void { Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)], 'username' => ['required', 'min:4', 'max:255', Rule::unique('users')->ignore($user->id)], 'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'], ])->validateWithBag('updateProfileInformation'); Loading @@ -33,7 +33,7 @@ public function update(User $user, array $input): void } else { $user->forceFill([ 'name' => $input['name'], 'email' => $input['email'], 'username' => $input['username'], ])->save(); } } Loading app/Models/User.php +3 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,9 @@ class User extends Authenticatable */ protected $fillable = [ 'name', 'email', //'email', 'username', 'active', 'password', ]; Loading config/fortify.php +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ | */ 'username' => 'email', 'username' => 'username', 'email' => 'email', Loading database/migrations/0001_01_01_000000_create_users_table.php +2 −1 Original line number Diff line number Diff line Loading @@ -14,9 +14,10 @@ public function up(): void Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('email')->unique(); $table->string('username')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->boolean('active')->default(0); $table->rememberToken(); $table->foreignId('current_team_id')->nullable(); $table->string('profile_photo_path', 2048)->nullable(); Loading Loading
app/Actions/Fortify/CreateNewUser.php +2 −2 Original line number Diff line number Diff line Loading @@ -21,14 +21,14 @@ public function create(array $input): User { Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'username' => ['required', 'string', 'max:255', 'min:4', 'unique:users'], 'password' => $this->passwordRules(), 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '', ])->validate(); return User::create([ 'name' => $input['name'], 'email' => $input['email'], 'username' => $input['username'], 'password' => Hash::make($input['password']), ]); } Loading
app/Actions/Fortify/UpdateUserProfileInformation.php +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ public function update(User $user, array $input): void { Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)], 'username' => ['required', 'min:4', 'max:255', Rule::unique('users')->ignore($user->id)], 'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'], ])->validateWithBag('updateProfileInformation'); Loading @@ -33,7 +33,7 @@ public function update(User $user, array $input): void } else { $user->forceFill([ 'name' => $input['name'], 'email' => $input['email'], 'username' => $input['username'], ])->save(); } } Loading
app/Models/User.php +3 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,9 @@ class User extends Authenticatable */ protected $fillable = [ 'name', 'email', //'email', 'username', 'active', 'password', ]; Loading
config/fortify.php +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ | */ 'username' => 'email', 'username' => 'username', 'email' => 'email', Loading
database/migrations/0001_01_01_000000_create_users_table.php +2 −1 Original line number Diff line number Diff line Loading @@ -14,9 +14,10 @@ public function up(): void Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('email')->unique(); $table->string('username')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->boolean('active')->default(0); $table->rememberToken(); $table->foreignId('current_team_id')->nullable(); $table->string('profile_photo_path', 2048)->nullable(); Loading