I have a column called decay. Either in the column there will be a past date or NULL. If there is a date, it means the object has left orbit or if its NULL the object is still in orbit.
What I am trying to do is to create a checkbox that allows me to filter my database to either display the object that is in orbit (NULL in column) or the object that has decayed (date in column).
I have already created a simple checkbox for my Laravel Blade file, my route and the controller for the page. I just need help with the Javascript and the Controller statement to filter it.
Blade:
<span><input type="checkbox" name="in-orbit" value="in-orbit">In Orbit</span>
<span><input type="checkbox" name="decayed" value="decayed">Decayed</span>
Javascript:
$('#decayed').on('change', function() {
$value = $(this).val();
$.ajax({
type: 'get',
url: '{{$launchsitename->site_code}}',
data: {
'search': $value
},
success: function(data) {
$('#launchsatdisplay').html(data);
}
});
});
arrayOfObjects.filter ((o) => o.decayed == null)in javascript or an equivalent in php