All Tutorials & Sample Codes

Browse all our Laravel 12, CodeIgniter 4, and PHP tutorials. Each guide includes working source code, best practices, and step-by-step instructions.

Showing 13–18 of 41 posts · Page 3 of 7

Implementing Multi-Factor Authentication (MFA/2FA) in Laravel 12 with Google Authenticator

<p>In today's digital landscape, securing user accounts is paramount. With cyber threats on the rise, relying solely on passwords is no longer sufficient. Multi-Factor Authentication (MFA), also known as Two-Factor Authentication (2FA), adds an extra layer of security by requiring a second verification method, such as a time-based one-time password (TOTP) from an app like Google Authenticator. In this step-by-step tutorial, you will learn how to implement MFA/2FA in a Laravel 12 application using the PragmaRX Google2FA package, complete with QR code setup, TOTP verification, recovery codes, and middleware protection.</p>

By Revathi M · Read

Install Bootstrap 5 in Laravel 12 with Vite (Step-by-Step)

Laravel 12 introduces a smoother and faster way to integrate Bootstrap using the official bootstrap-vite package. Instead of manually importing Bootstrap files and configuring Popper.js, Laravel's dedicated package handles everything automatically — from SCSS compilation to JavaScript module bundling with Vite. In this step-by-step guide, you'll learn how to set up Bootstrap 5 in minutes with zero manual configuration.

By Revathi M · Read

WhatsApp Cloud API Integration in Laravel 12: Complete Step-by-Step Guide

Learn how to integrate WhatsApp Cloud API with Laravel 12 in this hands-on tutorial. Build a reusable service class, send text and template messages, handle webhooks securely with HMAC verification, upload and send media, and follow production best practices — all using Laravel's native HTTP client with no third-party packages.

By Revathi M · Read

Laravel 12 WebSockets Without Node.js: Complete Guide with Laravel Reverb

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Real-time applications (like <b>chat apps, live notifications, dashboards</b>) usually require <b>WebSockets</b>. Traditionally, this is done with <b>Node.js + Socket.IO</b>, but in Laravel 12 we can build WebSocket-powered apps <b>without Node.js</b> using the <b>BeyondCode Laravel WebSockets package</b>.

By Revathi M · Read

How to Import CSV Files in Laravel 12 with Upsert – Complete 2025 Tutorial

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Importing data from CSV files is a common requirement in modern web applications — whether you're syncing users, products, contacts, or inventory records. In Laravel 12 (and earlier versions), the most efficient way to insert new records or update existing ones in bulk is by using the built-in upsert() method.

By Revathi M · Read