I am currently displaying a single JSON object value in the full calendar. I need to display the second JSON object as well.
<script>
$(document).ready(function(){
var booking_details = @json($booking_details);
// I need to display these json values also
var test = @json($test);
$("#calander").fullCalendar({
events: booking_details,
eventColor: '#FF0000'
});
});
</script>
This is the controller in Laravel:
$booking_details = array();
$bookings = Booking::all();
foreach ($bookings as $booking) {
$booking_details[] = [
'title'=>$booking->room_number,
'start'=>$booking->checkin_date,
'end'=>$booking->checkout_date
];
}
// this is testing purpose
$test = array();
foreach ($bookings as $booking) {
$test[] = [
'title'=>$booking->room_number,
'start'=>$booking->checkin_date,
'end'=>$booking->checkout_date
];
}
I'm sending the same data with a different JSON name. I only need how to display multiple JSON object values in the same calendar.