validate([ 'name' => ['required', 'string', 'max:40'], 'email' => ['required', 'email', 'max:120', 'unique:users,email'], 'password' => ['required', 'string', 'min:8', 'confirmed'], 'real_name' => ['nullable', 'string', 'max:40'], 'phone' => ['nullable', 'string', 'max:30'], 'company' => ['nullable', 'string', 'max:120'], 'industry' => ['nullable', 'string', 'max:60'], ]); $user = User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => $data['password'], 'real_name' => $data['real_name'] ?? null, 'phone' => $data['phone'] ?? null, 'company' => $data['company'] ?? null, 'industry' => $data['industry'] ?? null, ]); Auth::login($user); $user->awardPoints(20); return redirect('/'); } }