[eluser]OverZealous[/eluser]
[quote author="kre8ivdesigns" date="1281857684"]
Now how do I check if the day_id exists in the join table days_reservation to return to the client that dates are taken or available.[/quote]
Once you have the day, simply do:
Code:
if($day->reservation->count()) {
// day taken
} else {
// day not taken
}
This returns the number of reservations for a given day. As long as that can only be 0 or 1, this will work.
If you need to limit the reservations (ie: there can be more thab one reservation per day), simply add clauses into your statement: