It does not work, because your scopeRdate()
method is wrong. Change your method to:
public function scopeRdate($query, $date)
{
return $query->whereRdate($date);
}
Same should be applied to scopeClub
method. First parameter passed to scope method is query builder and next ones are actual parameters. So since you are trying to pass Query\Builder
instance into a whereRdate
method you obviously get the error as it can not be parsed to string. Hopefully it does make sense for you.
zaalbarxx said:
It does not work, because your
scopeRdate()
method is wrong. Change your method to:public function scopeRdate($query, $date) { return $query->whereRdate($date); }
Same should be applied to
scopeClub
method. First parameter passed to scope method is query builder and next ones are actual parameters. So since you are trying to passQuery\Builder
instance into awhereRdate
method you obviously get the error as it can not be parsed to string. Hopefully it does make sense for you.
It makes perfect sense many thanks all working now :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community