Laravel 8 Livewire Datatables Tutorial

Laravel 8 livewire dataTable example tutorial. In this tutorial, you will learn how to install livewire datatable and implement dataTable in laravel 8 app using the livewire datatable.

So, you’ll learn how to integrate datatables in laravel 8 using livewire. This tutorial will give you easy example of laravel 8 mediconesystems/livewire-datatables.

Laravel 8 Livewire DataTable Example Tutorial

  • Step 1 – Download Laravel 8 App
  • Step 2 – Connecting App To Database
  • Step 3 – Install Livewire & DataTable Livewire
  • Step 4 – Build User DataTable Livewire Component
  • Step 5 – Create Routes
  • Step 6 – Update UserDataTable Component File
  • Step 7 – Update Welcome Blade File
  • Step 8 – Start Development Server

Step 1 – Download Laravel 8 App

First of all, download or install laravel 8 new setup. So, open the terminal and type the following command to install the new laravel 8 app into your machine:

composer create-project --prefer-dist laravel/laravel Laravel8CRUD

Step 2 – Connecting App To Database

Setup database with your downloaded/installed laravel 8 app. So, you need to find .env file and setup database details as following:


Step 3 – Install Livewire & DataTable Livewire

In this step, execute the following command on terminal to install livewire and dataTables livewire package in laravel 8 app:

composer require livewire/livewire

composer require mediconesystems/livewire-datatables

Then, execute the “npm install && npm run dev” command to build your assets:

npm install

To run npm:

npm run dev

Then, Execute the following command on the terminal to create tables into the database:

php artisan migrate

Step 4 – Build User DataTable Livewire Component

In this step, create users dataTable livewire components by executing the following command on terminal:

php artisan make:livewire user-datatables

This command will create two files, which is located on following path:



Step 5 – Create Routes

In this step, create routes for laravel crud app. So, open web.php file from the routes directory of laravel livewire data tables app. And update the following routes into the web.php file:

Route::get('user-datatables', function () {
    return view('welcome');

Step 6 – Update UserDataTable Component File

Now, update the UserDatatables.php component file with the following code, which is placed on app/Http/Livewire directory:

namespace App\Http\Livewire;
use Livewire\Component;
use App\Models\User;
use Illuminate\Support\Str;
use Mediconesystems\LivewireDatatables\Column;
use Mediconesystems\LivewireDatatables\NumberColumn;
use Mediconesystems\LivewireDatatables\DateColumn;
use Mediconesystems\LivewireDatatables\Http\Livewire\LivewireDatatable;
class UserDatatables extends LivewireDatatable
    public $model = User::class;
     * Write code on Method
     * @return response()
    public function columns()
        return [
                ->label('Creation Date')

Step 7 – Update Welcome Blade File

In this step, open welcome.blade.php file and update the following code into it, which is placed on resources/views/ directory:

<!DOCTYPE html>
    <title>Laravel 8 Livewire DataTable Example -</title>
    <link rel="stylesheet" href="" integrity="sha512-l7qZAq1JcXdHei6h2z8h8sMe3NbMrmowhOl+QkP3UhifPpCW2MC4M0i26Y8wYpbz1xD9t61MLT9L1N773dzlOA==" crossorigin="anonymous" />
<div class="container">
    <div class="card">
      <div class="card-header">
        Laravel Livewire Example -
      <div class="card-body">
            searchable="name, email"

Now, execute the following command on the terminal to create dummy records in database:

php artisan tinker


Step 8 – Start Development Server

Last step, open command prompt and run the following command to start developement server:

php artisan serve

Then open your browser and hit the following url on it:

Recommended Laravel Posts


My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS, React Js, MySQL, MongoDB, REST APIs, Windows, Xampp, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published. Required fields are marked *