How to Create Custom Validation Rule in CodeIgniter 4

Validation rules help to validate the form. You don’t need to write long if statement conditions for every <form > element.

CodeIgnite­r 4 comes equipped with nume­rous pre-defined validation rule­s. However, there­ may be instances where­ you require custom validation rules de­signed specifically for your application’s nee­ds.

In this article, we’ll discuss how to create­ such custom validation rules in CodeIgniter 4. By doing so, you can broade­n the framework’s validation capabilities and maintain data accuracy. Follow the­se steps to seamle­ssly handle distinct and diverse validation sce­narios while extending the­ validating functionality of your web applications alike.

How to create custom validation Rule in CodeIgniter 4

Read more

Add Google reCAPTCHA v2 to form in CodeIgniter 4

Google reCaptcha helps to protect the website against spam and bot submissions. It is mainly applied to login, registration, contact us, and add comment forms.

There are 2 versions of Google reCaptcha –

  1. v2 – User needs to select images based on the question.
  2. v3 – This is an invisible type of captcha.

In this tutorial, I show how you can add google recpatcha v2 to your form with validation in the CodeIgniter 4 project.

Add Google reCAPTCHA v2 to form in CodeIgniter 4

Read more

Create Livewire pagination with Search filter and Sorting in Laravel

Pagination is very useful when you have to show a huge list of records on the page. It divides the records into multiple pages.

Limited number of records shown at a time.

Livewire has provided the WithPagination trait for generating pagination. Its implementation is similar to Laravel default pagination.

In this tutorial, I show how you can create Livewire pagination with search filter and sorting in Laravel 9.

Create Livewire pagination with search filter and sorting in Laravel

Read more

How to Create simple Accordion using JavaScript

Accordion is an expandable and collapsible container which used to manage related data. It consumes less space and shows content in a user-friendly format.

There are already lots of jQuery plugins for implementing this, like – jQuery UI, Bootstrap, accordion.js, etc.

In this tutorial, I show how you can create accordion using JavaScript.

How to Create simple accordion using JavaScript

Read more