How to create Helper function and use it in Laravel

A Helper function is a small piece of code that performs a specific task or operation and can be used anywhere in your application.

In Laravel you need to create a new PHP file to write Helper functions and specify the file path in the composer.json file.

In this article, you will learn how to create Helper functions in Laravel and how to use it.

How to Create and Use Helper function in CodeIgniter 4

Read more

How to add pagination using Yajra Datatables in Laravel 9

DataTables is a jQuery library for implementing pagination.

For adding AJAX pagination needs to write a long script that – count total records with and without filters, fetch records, initialize Array with data, and return the JSON array with required fields.

In Laravel, there is a Yajra DataTables package that makes this pagination process a little easier to implement.

How to add pagination using Yajra Datatables in Laravel 9

Read more

How to Check if element has class in JavaScript

CSS classes are very helpful when need to add same style on multiple HTML elements. However, classes are not limited to styling alone; they also enable us to perform various actions based on the presence or absence on an element.

In this tutorial, I show how you can check specific class on single or multiple elements using JavaScript with examples.

How to Check if element has class in JavaScript

Read more

How to Send GET and POST cURL request in CodeIgniter 4

The CURLRequest class that comes pre-installed in Codeigniter 4 makes it easy to send cURL request from the application.

It allows you to make requests via GET, POST, PUT, and other methods on various endpoints.

With this blog post, you will be able to understand about sending cURL GET and POST request using CURLRequest Class in CodeIgniter 4 and implement it in your project.

How to Send GET and POST cURL request in CodeIgniter 4

Read more