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 25–30 of 41 posts · Page 5 of 7

Generate PDF from HTML in Laravel 11 Using TCPDF – Complete Tutorial

Generating PDF files is essential for invoices, reports, receipts, and certificates in Laravel applications. While popular options like <b>barryvdh/laravel-dompdf</b> or <b>spatie/laravel-pdf</b> (using Chromium for modern CSS) dominate in 2025–2026, TCPDF remains a solid, pure-PHP choice with no external dependencies. It excels at precise control over layout and supports HTML + basic CSS.<br> In this tutorial, we'll build a complete invoice PDF generator in <b>Laravel 11</b> using the <span class="highlight">elibyy/tcpdf-laravel</span> package. By the end, you'll generate downloadable PDFs from Blade views.

By Revathi M · Read

Laravel 11 Stripe Payment Gateway Integration: Step-by-Step Tutorial

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Stripe remains one of the most popular payment gateways for Laravel applications thanks to its robust API, strong security (PCI compliance), and support for global payments. In this updated <b>Laravel 11 Stripe integration tutorial</b> (compatible with 2026 best practices), we'll implement a secure one-time payment system using Stripe.js for client-side tokenization and the Stripe PHP library for server-side processing.

By Revathi M · Read

How to Add Social Media Share Buttons in Laravel 11 – Step-by-Step Tutorial

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;In today's digital landscape, driving organic traffic and increasing user engagement is essential for any Laravel-powered blog, e-commerce site, portfolio, or content platform. One of the simplest yet most effective ways to achieve this is by integrating <strong>social media share buttons</strong> directly into your pages. When visitors can easily share your articles, products, or posts on platforms like Facebook, X (Twitter), LinkedIn, WhatsApp, Telegram, Reddit, and more, your content reaches wider audiences without paid promotion.

By Revathi M · Read

Laravel 11 JWT Authentication Tutorial: Build a Secure RESTful API from Scratch

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JSON Web Tokens (JWT) provide a stateless, secure way to authenticate users in RESTful APIs. In this complete Laravel 11 JWT authentication tutorial, you'll learn to set up a production-ready API with user registration, login, token management, and protected endpoints using the reliable <span class="highlight">php-open-source-saver/jwt-auth</span> package (a maintained fork of the original tymon/jwt-auth).

By Revathi M · Read

Laravel 11: Load More Data on Page Scroll Using jQuery AJAX (Infinite Scroll Tutorial)

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;In today's web applications, infinite scrolling provides a smooth, engaging user experience — think Instagram or Twitter feeds. Instead of clicking "Next Page", content loads automatically as the user scrolls down.<br /> In this Laravel 11 tutorial, you'll learn how to implement <strong>load more data on scroll</strong> using jQuery and AJAX. We'll use Laravel's built-in pagination combined with an AJAX call to fetch additional records dynamically from the database.

By Revathi M · Read

Laravel 11 Sanctum REST API Authentication: Complete Tutorial with Example

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Welcome to this up-to-date guide on implementing secure <strong>Laravel 11 Sanctum REST API authentication</strong>. Whether you're building a mobile app backend, a single-page application (SPA), or a simple token-based API, Laravel Sanctum remains the go-to lightweight solution in 2026. This step-by-step tutorial covers everything from installation using the modern <code>php artisan install:api</code> command to registration, login, protected routes, token management, and a full CRUD example. By the end, you'll have a production-ready authenticated API ready for testing in Postman or your frontend.

By Revathi M · Read