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

What is Accessors And Mutators in Laravel 9?

Sometimes need to modify a field value while retrieving records using Laravel Eloquent e.g. get date from datetime field, make field value in upper case, etc.

To do that you can either use selectRaw() or Accessors.

Similarly, If you want to update the value while inserting or updating using Eloquent then you can either modify value every time before storing or use Mutators.

In this tutorial, I show how you can use Accessors And Mutators in the Laravel 9 project.

What is Accessors And Mutators in Laravel?

Read more