Laravel 8 Table Inline Edit Using JQuery Editable

Laravel 8 , Laravel 7 , Laravel , Laravel 6




Laravel 8 Table Inline Edit Using JQuery Editable

Hi Dev,

Inside this article we will see the concept of inline row data edit in laravel 8. This article will use the jquery editable plugin for inline edit of data records.

We will learn about Laravel 8 inline row edit using jquery editable plugin in a very easy way. It will easy and step by step guide to implement it.

step : 1 Create project

first of all we need to get fresh Laravel 8 version application using bellow command, So open your terminal OR command prompt and run bellow command:

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

step : 2 Create Database & Connection

To create a database, either we can create via Manual tool of PhpMyadmin or by means of a mysql command.


To connect database with application, Open .env file from application root. Search for DB_ and update your details.







step : 3 Create Route

Open web.php file from /routes folder. Add these given routes into it.


use Illuminate\Support\Facades\Route;

use App\Http\Controllers\ProductController;

// Inline Editor

Route::get('product', [ProductController::class, 'index'])->name('product.index');

Route::post('product', [ProductController::class, 'update'])->name('product.update');

Route::post('product/delete/{id}', [ProductController::class, 'delete'])->name('product.delete');

step : 4 Create Controller

Back to terminal and run this command to create controller file.

php artisan make:controller ProductController

It will create ProductController.php file inside /app/Http/Controllers folder.


namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Models\Product;

class ProductController extends Controller



* Display a listing of the resource.


* @return \Illuminate\Http\Response


public function index(Request $request)


$product = Product::get();

return view('product', compact('product'));



* Write code for update


* @return response()


public function update(Request $request)


if ($request->ajax()) {



$request->name => $request->value


return response()->json(['success' => true]);




* Write code for delete


* @return response()


public function delete($id)


$product = Product::find($id);


return response()->json(['success' => 'success']);



step 5 : Create Blade File

Create Product.blade.php file inside /resources/views folder.

Open Product.blade.php and write this complete code into it.

<!DOCTYPE html>



<title>Laravel 8 Table Inline Edit Using JQuery Editable -</title>

<meta name="csrf-token" content="{{ csrf_token() }}">

<link rel="stylesheet" href="">

<script src=""></script>

<link href="" rel="stylesheet" />

<link href="" rel="stylesheet" />

<script src=""></script>

<script src=""></script>


<style type="text/css">

.container h2 , .panel-info{






<div class="container">

<div class="col-md-8 col-md-offset-2">

<h2 class="text-center">Laravel 8 Table Inline Edit Using JQuery Editable -</h2>

<div class="panel panel-info">

<div class="panel-heading">Laravel 8 Table Inline Edit Using jQuery editable</div>

<div class="panel-body">

<table class="table table-bordered data-table">










@foreach($product as $product)


<td>{{ $product->id }}</td>


<a href="" class="update" data-name="name" data-type="text" data-pk="{{ $product->id }}" data-title="Enter name">{{ $product->name }}</a>



<a href="" class="update" data-name="detail" data-type="text" data-pk="{{ $product->id }}" data-title="Enter Detail">{{ $product->detail }}</a>



<a class="deleteProduct btn btn-xs btn-danger" data-id="{{ $product->id }}">Delete</a>










<script type="text/javascript">

$.fn.editable.defaults.mode = 'inline';


headers: {

'X-CSRF-TOKEN': '{{ csrf_token() }}'




url: "{{ route('product.update') }}",

type: 'text',

pk: 1,

name: 'name',

title: 'Enter name'




var id = $(this).data("id");

var token = '{{ csrf_token() }}';




url: "product/delete/"+id,

data: {_token: token},

success: function(data)









step 6 : Create Model

Type this command to create model.

php artisan make:model Product

It will create Product.php file inside /app/Models/Product.php.


namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;

use Illuminate\Database\Eloquent\Model;

class Product extends Model


protected $fillable = [

'name', 'detail'



step 7 : Start Application

Open project to terminal and type the command to start development server

php artisan serve

Now you can open bellow URL on your browser:



i hope it can help you...

Recommended Posts