Skip to content

Commit cc61929

Browse files
committed
Code cleanup
1 parent 248a583 commit cc61929

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

src/ServiceProvider.php

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,5 @@ public function boot()
2525
Builder::macro('whereLatest', function ($column, $value) {
2626
return $this->latestRelation()->where($column, $value);
2727
});
28-
29-
// Builder::macro('latestRelation', function ()
30-
// {
31-
// if(! $where = $this->wheres[0]['second'] ?? null) {
32-
// throw new \InvalidArgumentException('Second join parameter is not specified. The latestRelation() method should only be called from within a whereHas() on a hasMany relationship.');
33-
// }
34-
35-
// list($table, $parentRelatedColumn) = explode('.', $where);
36-
37-
// return $this->where($table . '.id', function ($sub) use ($where, $table, $parentRelatedColumn) {
38-
// $sub->select('id')
39-
// ->from($table . ' AS sub')
40-
// ->whereColumn('sub.' . $parentRelatedColumn, $where)
41-
// ->latest()
42-
// ->take(1);
43-
// });
44-
// });
45-
46-
// Builder::macro('whereLatest', function ($column, $value)
47-
// {
48-
// return $this->latestRelation()->where($column, $value);
49-
// });
50-
51-
// Builder::macro('latestRelationTwo', function () {
52-
// if(! $where = $this->wheres[0] ?? null) {
53-
// throw new \InvalidArgumentException('Second join parameter is not specified. The latestRelation() method should only be called from within a whereHas() on a hasMany relationship.');
54-
// }
55-
56-
// return $this->where('id', function ($sub) use ($where) {
57-
// $sub->from($this->from)
58-
// ->selectRaw('max(id)')
59-
// ->whereRaw($where['first'] . ' = ' . $where['second']);
60-
// });
61-
// });
62-
63-
// Builder::macro('whereLatestTwo', function ($column, $value) {
64-
// return $this->latestRelationTwo()->where($column, $value);
65-
// });
6628
}
6729
}

0 commit comments

Comments
 (0)