File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,9 @@ public function last()
160160
161161 public function getRelationFromApi ()
162162 {
163- $ this ->relation = $ this ->newRelation ($ this ->updateFields ([]))->setPassOnAttributes ($ this ->getUpdateKeys ())->all ();
163+ if (method_exists ($ relation = $ this ->newRelation ($ this ->updateFields ([])), 'setPassOnAttributes ' )) {
164+ $ this ->relation = $ relation ->setPassOnAttributes ($ this ->getUpdateKeys ())->all ();
165+ }
164166 if ($ this ->hasUpdateFields ()){
165167 foreach ($ this ->relation as $ object ){
166168 $ this ->updateFields ($ object );
@@ -201,7 +203,10 @@ public function __call($method, $parameters)
201203 if ($ this ->relation ->count () > 0 && method_exists ($ this ->relation , $ method )){
202204 return $ this ->forwardCallTo ($ this ->relation , $ method , $ parameters );
203205 } else {
204- $ relation = $ this ->newRelation ($ this ->updateFields ([]))->setPassOnAttributes ($ this ->getUpdateKeys ());
206+ $ relation = $ this ->newRelation ($ this ->updateFields ([]));
207+ if (method_exists ($ relation , 'setPassOnAttributes ' )){
208+ $ relation ->setPassOnAttributes ($ this ->getUpdateKeys ());
209+ }
205210 return $ this ->forwardCallTo ($ relation , $ method , $ parameters );
206211 }
207212 }
You can’t perform that action at this time.
0 commit comments