DEV Community

Cover image for Agrega la opción de verificación de emails con Laravel Jetstream.
Ariel Mejia for Devscamp

Posted on • Edited on

Agrega la opción de verificación de emails con Laravel Jetstream.

Modificar el archivo "config/fortify.php":

Debemos quitar el comentario sobre este feature.

'features' => [
    Features::registration(),
    Features::resetPasswords(),
    Features::emailVerification(),
    Features::updateProfileInformation(),
    Features::updatePasswords(),
    Features::twoFactorAuthentication([
        'confirmPassword' => true,
]),
Enter fullscreen mode Exit fullscreen mode

En el modelo User implementar la interface "MustVerifyEmail":

class User extends Authenticatable implements MustVerifyEmail
Enter fullscreen mode Exit fullscreen mode

Agregar un servicio proveedor de correos de prueba.

Puedes usar mailhog, pero el mas conocido y utilizado para pruebas en mailtrap.io, te logueas gratis y el servicio para una sola cuenta no tiene costo.

Agregas las llaves del servicio de mail

En tu archivo ".env" agrega las credenciales del servicio seleccionado, aquí un ejemplo con mailtrap.io

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=273b5ab0b82231
MAIL_PASSWORD=b5612d6ea6iir3
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="admin@tuapp.com"
MAIL_FROM_NAME="${APP_NAME}"
Enter fullscreen mode Exit fullscreen mode
Nota

Si deseas trabajar en producción, uno de los servicios mas beneficiosos y fáciles de implementar es Sendgrid.

Espero el post sea de utilidad.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs