Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

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.

0

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 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.

It makes perfect sense many thanks all working now :)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.