File tree 2 files changed +4
-9
lines changed 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ abstract class Controller extends \Illuminate\Routing\Controller
26
26
*/
27
27
public static $ resource ;
28
28
29
- //@TODO: voir si toutes ces manières de call en static c'est pas plus dérangeant qu'autre chose
30
- //@TODO: surtout avec octane où il faut éviter le static !?
31
29
/**
32
30
* Get a fresh instance of the resource represented by the entry.
33
31
*
@@ -39,6 +37,4 @@ public static function newResource(): Resource
39
37
40
38
return new $ resource ;
41
39
}
42
-
43
- //@TODO: are controllers useless in a certain way ??
44
40
}
Original file line number Diff line number Diff line change @@ -51,11 +51,10 @@ public function search(array $parameters = []) {
51
51
$ this ->applyAggregates ($ parameters ['aggregates ' ]);
52
52
});
53
53
54
- // @TODO: is this a problem also with HasMany ??
55
- // @TODO: this will be the problem for every relation, need to fix this
56
- // In case of BelongsToMany we cap the limit
57
- $ limit = $ this ->queryBuilder instanceof \Illuminate \Database \Eloquent \Relations \BelongsToMany ? 9999 : ($ parameters ['limit ' ] ?? 50 );
58
- $ this ->queryBuilder ->limit ($ limit );
54
+ // In case we are in a relation we don't apply the limits since we dont know how much records will be related.
55
+ if (!$ this ->queryBuilder instanceof Relation) {
56
+ $ this ->queryBuilder ->limit ($ parameters ['limit ' ] ?? 50 );
57
+ }
59
58
60
59
return $ this ->queryBuilder ;
61
60
}
You can’t perform that action at this time.
0 commit comments