I do a search with 3 inputs and then input can be empty
i get variables from the front-end
$addressSearch = $request->json()->get('addressSearch');
$typeSearch = $request->json()->get('typeSearch');
$statusSearch = $request->json()->get('statusSearch');
I do this search use the function inside the query
$property = Property::where('id', '1')
->Where(function($query)
{
$query->Where('type',typeSearch)
->orWhere('status',$statusSearch)
->orWhere('street','LIKE',"% $addressSearch}%");
})
->get();
and I get this error:
message: "Undefined property: App\Http\Controllers\PropertyController::$typeSearch
the variable receives the value normally