sumitgroup
4 months ago
254
1
Laravel

How to filter data using ajax in Laravel From Single Table?

Posted 4 months ago by sumitgroup

Hi, I have a (listings) table in my database, and it's belongsTo (properties) table. Now i want to filter data from this (listings) table, please let me know how i can filter data using AJAX.

This is my Propertcontroller.php file

public function searchProperty(Request $r) { $trans=$r->transType; $list=Listing::where('lstId', '>', 30)->orWhere('transaction_type', 'Resale')->get(); dd($list); return view('listings', compact('list')); }

Route.php

Route::match(['get','post'], '/filter','[email protected]')->name('property.filter');

listings.blade.php

  • New Booking
  • Resale

Please sign in or create an account to participate in this conversation.