File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
src/Database/Eloquent/Relations Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,11 @@ This package is built and maintained by [Gearbox Solutions](https://gearboxgo.co
2525* And more!
2626
2727## Requirements
28- Laravel 7.3 or later.
28+ Laravel 9.0+
29+
30+ PHP 8.0+
31+
32+ For Laravel versions greater than 7.3 and less than 9.0, use version [ 0.2.10] ( https://github.com/gearbox-solutions/eloquent-filemaker/blob/0.2.10 )
2933
3034# Installation
3135Install ` gearbox-solutions/eloquent-filemaker ` in your project using Composer.
Original file line number Diff line number Diff line change @@ -19,4 +19,11 @@ public function addConstraints()
1919 }
2020 }
2121
22+ protected function getKeys (array $ models , $ key = null )
23+ {
24+ return collect ($ models )->map (function ($ value ) use ($ key ) {
25+ return $ key ? $ value ->getAttribute ($ key ) : $ value ->getKey ();
26+ })->values ()->filter ()->unique (null , true )->sort ()->all ();
27+ }
28+
2229}
Original file line number Diff line number Diff line change @@ -17,4 +17,11 @@ public function addConstraints()
1717 $ this ->query ->where ($ this ->foreignKey , '== ' , $ this ->getParentKey ());
1818 }
1919 }
20+
21+ protected function getKeys (array $ models , $ key = null )
22+ {
23+ return collect ($ models )->map (function ($ value ) use ($ key ) {
24+ return $ key ? $ value ->getAttribute ($ key ) : $ value ->getKey ();
25+ })->values ()->filter ()->unique (null , true )->sort ()->all ();
26+ }
2027}
You can’t perform that action at this time.
0 commit comments