How to add Foreign key in Migration – Laravel

In Laravel, migrations are a way to modify and manage the database schema of the application. A foreign key is a field that is used to establish the relationship between two tables via the primary key (You can also use a non-primary field but not recommended).

In this tutorial, I show how you can add a foreign key constraint while creating a table using migration in the Laravel 10 project.

How to add Foreign key in migration - Laravel

Read more

Datatables AJAX pagination with Search and Sort in Laravel 10

In today’s web applications, it is e­ssential to present e­xtensive sets of data in a way that e­ngages and invites interaction with the­ user. AJAX-based pagination, search, and sorting te­chniques are valuable re­sources when trying to improve navigation for your use­rs.

These methods allow visitors to move­ efficiently through data tables without inte­rruptions or delays caused by reloading the­ entire page.

In this article, we will explore the process of implementing AJAX pagination with search and sort functionality using DataTables library in Laravel 10 without relying on external packages like Yajra.

DataTables AJAX pagination with Search and Sort in Laravel

Read more

How to make Autocomplete search using jQuery UI in Laravel

Autocomplete search enhances website user experience by predicting and completing search queries as the user types. Users can quickly find what they looking for without having to type out their entire query.

jQuery UI has different types of widgets available, and one of them is autocomplete. Data is loaded according to the input after initializing autocomplete on a textbox. User can select an option from the suggestion list.

In this tutorial, I show how you can make autocomplete search using jQuery UI and load its data using AJAX in Laravel 9.

How to make Autocomplete search using jQuery UI in Laravel

Read more

Auto populate Dropdown with jQuery AJAX in Laravel 9

Dropdown menus are a common element in web applications, it provides a list of options to choose from.

While dropdowns can be manually populated with a set of predefined options, it’s often more efficient to retrieve the options dynamically from a server. In this case, user is restricted to select an option from the dropdown. The list gets updated based on the parent element selection.

In this tutorial, I show how you can autopopulate dropdown with MySQL database data using jQuery AJAX in Laravel 9.

Auto populate Dropdown with jQuery AJAX in Laravel

Read more