Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

prince69's avatar

How to implement 2fa into laravel application?

I have a Laravel API project built on Laravel 8, and its frontend is developed in Next.js. Now, I want to implement Google 2FA (Two-Factor Authentication) into my project without installing any packages. How can I do this?

Can anyone guide me how to do that?

0 likes
5 replies
krisi_gjika's avatar

2fa is not included in core laravel, so you either need to install some packages or create the package yourself

prince69's avatar

@Tray2 Jetstream can be installed on a Laravel backend, but how can I implement it in the frontend? My frontend is built with Next.js. How can I manage the connection between Next.js and the Laravel backend using Jetstream?

martinbean's avatar

I want to implement Google 2FA (Two-Factor Authentication) into my project without installing any packages. How can I do this?

@prince69 If you want to re-invent the wheel then you’ll need to write the code yourself.

Please or to participate in this conversation.