I have an App bulit using Laravel 5 with a scope configured to get a list of results but it only returns one result when invoked.
Code:
public function scopeBookingDate($query, $date)
{
return $query->where('booking_date', "LIKE", $date . "%");
}
Invoked like this:
$bookings = Booking::bookingDate($date)->get();
Is there something I'm missing?
Enable Query log and let's see what your code is generating. it can be helpful:
\DB::enableQueryLog();
$bookings = Booking::bookingDate($date)->get();
\DB::getQueryLog();